commit e72af5ea3180fe1d017fef23b73ae1ee7f43f985
parent 0fedd3a60cf8665403dbc99f683dffaca24cf119
Author: Andrew Laack <andrew@laack.co>
Date: Sat, 10 Oct 2026 20:39:49 -0500
Merge
Diffstat:
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/posts/wip/basic-software-profiling-cpu-usage.md b/posts/wip/basic-software-profiling-cpu-usage.md
@@ -248,6 +248,36 @@ This is very unscientific, but that's how I like to start profiling. Given how u
Since Amfora can highlight code, let's see how the performance changes when we add our python code block from above to the top of the file and rename the file to lf.gmi:
```
+perf stat foreseen lf.gmi
+
+ Performance counter stats for 'foreseen lf.gmi':
+
+ 0 context-switches:u # 0.0 cs/sec cs_per_second
+ 0 cpu-migrations:u # 0.0 migrations/sec migrations_per_second
+ 6,551 page-faults:u # 90396.7 faults/sec page_faults_per_second
+ 72.47 msec task-clock:u # nan CPUs CPUs_utilized
+ 154,134 branch-misses:u # 0.1 % branch_miss_rate
+ (88.98%)
+ 166,258,529 branches:u # 2294.2 M/sec branch_frequency
+ (88.99%)
+ 232,523,911 cpu-cycles:u # 3.2 GHz cycles_frequency
+ (88.96%)
+ 705,288,446 instructions:u # 3.0 instructions insn_per_cycle (88.93%)
+ TopdownL1 # 7.6 % tma_backend_bound
+ # 23.2 % tma_bad_speculation
+ (88.96%)
+ # 18.8 % tma_frontend_bound
+ (77.41%)
+ # 50.4 % tma_retiring
+ (88.45%)
+
+ 0.381682961 seconds time elapsed
+
+ 0.058132000 seconds user
+ 0.015949000 seconds sys
+```
+
+```
perf stat amfora lf.gmi
Performance counter stats for 'amfora lf.gmi':
@@ -271,7 +301,7 @@ perf stat amfora lf.gmi
8.207151000 seconds sys
```
-That's a lot slower for Amfora (TODO). Let's look at a flamegraph for this.
+That's a lot slower for Amfora. Let's look at a flamegraph for this.
<object data="https://blog.laack.co/images/amfora-before.svg" type="image/svg+xml" width="100%"></object>