From f0b6b48a4369fdd889c728b0e754eb0aa41fabe4 Mon Sep 17 00:00:00 2001 From: Matt Parrett Date: Sun, 19 Jul 2026 14:49:57 -0700 Subject: [PATCH] bench: document the two AOT mechanisms behind the results table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Performance table presents one undifferentiated AOT column, which makes the reduce row (1.7x slower under AOT) read as an anomaly. The emitted Go splits the fixtures cleanly: fib/tak/loop-recur lower to native code over unboxed ints (the 20-26x wins); the four seq rows only get a native run wrapper around the same boxed runtime calls the VM makes, so they tie or lose by construction until #270/#358 reach those bodies. Name the split under the table so every row reads as expected. Framing only — numbers are unchanged from the #578 recapture. Co-Authored-By: Claude Fable 5 --- benchmark/results.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/benchmark/results.md b/benchmark/results.md index a11999320..318a7f9db 100644 --- a/benchmark/results.md +++ b/benchmark/results.md @@ -55,3 +55,16 @@ Clojure JVM times include full JVM startup (~350-500ms) which dominates short be | tak | 2.397s ± 0.022s (1.0x) | **93.7ms ± 0.6ms** (0.0x) | 1.908s ± 0.037s (0.8x) | 0.613s ± 0.046s (0.3x) | | transducers | 46.5ms ± 0.9ms (1.0x) | 43.0ms ± 1.0ms (0.9x) | **20.3ms ± 0.5ms** (0.4x) | 0.373s ± 0.011s (8.0x) | +### Reading the AOT column + +The AOT numbers mix two mechanisms: + +- **Lowered to native code** — fib, tak, loop-recur. The hot code compiles to + native Go over unboxed ints (direct recursion, plain loops); only the leaves + box. This is where the 20-26x comes from. +- **Trampolined** — reduce, map-filter, persistent-map, transducers. The entry + point compiles, but the hot operations still run through the same boxed + runtime the VM uses, so these rows track the VM around parity (0.9-1.0x + here) — the reduce row's 1.7x is that wrapper's overhead, not an AOT + regression. Lowering doesn't reach these bodies yet. +