From 11474ecbdaeb8d6c9fa0f37c1c14623dc653627f Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 13 Sep 2026 23:15:17 +0700 Subject: [PATCH] The benchmark table, filled in --- spike/x86/COST.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spike/x86/COST.md b/spike/x86/COST.md index 54fa2fd..47d2f1b 100644 --- a/spike/x86/COST.md +++ b/spike/x86/COST.md @@ -100,7 +100,16 @@ Four programs in `spike/x86/bench/`, each written so that one suspected cost is They are in a subdirectory on purpose: `survey.sh` globs `spike/x86/*.flan` and a benchmark is not a case. Times are best-of-seven, in milliseconds. -BENCH_TABLE +| bench | what it is | LLVM -O2 | LLVM -O0 | x86 | x86 / -O0 | own code, -O0 → x86 | +|---|---|---|---|---|---|---| +| `b1-calls` | 20M calls of a one-instruction function | 2.1 | 36.8 | 104.3 | 2.8× | 200 → 807 | +| `b2-bounds` | 20.5M bounds-checked array loads | 4.7 | 27.0 | 112.6 | 4.2× | 407 → 1390 | +| `b3-spill` | 5M iterations of a six-deep arithmetic tree | 22.2 | 29.0 | 137.3 | 4.7× | 248 → 1117 | +| `b4-copy` | 2M copies of a 64-byte struct | 2.0 | 7.2 | 20.8 | 2.9× | 348 → 877 | + +`b2` with `--no-bounds-checks` on both sides: LLVM 4.5ms, x86 105.0ms — the 7.6ms the check costs over 20.5 +million of them, and the 241 bytes it costs in `flan.main`, are the whole of it. + `b1-calls` and `b3-spill` are the pair to read together. `b1` is 20 million calls of a one-instruction function and lands at 2.8× `-O0`; `b3` is no calls at all, six dependent arithmetic temporaries per iteration, and lands