75f7fda788
Closes the apples-to-apples gap from 21'e. Adds: - examples/bench_list_sum_explicit.ailx — same algorithm and sizes as bench_list_sum, fully (borrow)/(own)/(drop-iterative) annotated so codegen emits proper inc/dec instrumentation. - bench/reference/list_sum_explicit_free.c — same algorithm with explicit free() walking the chain after sum. The full alloc+dec vs malloc+free comparison reveals two non- trivial conclusions: 1. AILang's full RC pipeline is only 26% slower than glibc malloc+free on this workload (rc/c = 1.26x). The implicit- mode comparison's 1.42x was misleading — it counted neither pipeline's free path. The fair ratio is 1.26x, materially better than the previous read. 2. RC's dec is cheaper per cell than glibc free(). AILang dec-tax: ~3 ns/cell. C free-tax: ~5.5 ns/cell. Plausible cause: ailang_rc_dec operates on a known-shape cell with a fixed-offset refcount and a static per-type drop fn — no free-list bucketing, no header introspection, no global lock. bump's advantage expresses fully: bench_list_sum_explicit.bump/c = 0.42x means AILang at bump is 2.4x faster than C malloc+free. Sets a useful upper bound on a slab/pool RC allocator's potential. The 21'-family arc — bench-regression infrastructure — is now substantively complete: 21'a (bench/check.py), 21'b (corpus widening), 21'c (compile_check.py), 21'd (pure-compute fixtures + harness hardening), 21'e (cross-language hand-C), 21'f (explicit apples-to-apples). 63 runtime metrics + 18 compile metrics + 25 cross-lang metrics under regression coverage. Any future iter that regresses any axis beyond tolerance gets caught at the next family close. Remaining queue is back to substantive language work — Family 21 (typeclasses / polymorphic ADTs at runtime / pattern-binding generalisation) is now an orchestrator-level fork that needs direct user input.
94 lines
5.1 KiB
JSON
94 lines
5.1 KiB
JSON
{
|
|
"version": 1,
|
|
"captured": "2026-05-09",
|
|
"captured_via": "bench/run.sh -n 5",
|
|
"note": "Baseline for bench/check.py regression detection. Decision-10 thresholds (rc/bump <= 1.3x throughput, p99/median <= 5x latency) are LANGUAGE invariants, not regression-check tolerances. The tolerances below are tuned to absorb run-to-run noise on a quiet developer machine; they are NOT the correctness bar. To update after an intentional change, re-run bench/run.sh and replace the values, recording the reason in the JOURNAL entry that ships the baseline bump.",
|
|
|
|
"throughput": {
|
|
"bench_list_sum": {
|
|
"gc_s": { "baseline": 0.137, "tolerance_pct": 10 },
|
|
"bump_s": { "baseline": 0.046, "tolerance_pct": 10 },
|
|
"rc_s": { "baseline": 0.133, "tolerance_pct": 10 },
|
|
"gc_over_bump": { "baseline": 2.98, "tolerance_pct": 8 },
|
|
"rc_over_bump": { "baseline": 2.89, "tolerance_pct": 8 },
|
|
"gc_rss_kb": { "baseline": 103980, "tolerance_pct": 5 },
|
|
"bump_rss_kb": { "baseline": 97696, "tolerance_pct": 5 },
|
|
"rc_rss_kb": { "baseline": 193448, "tolerance_pct": 5 }
|
|
},
|
|
"bench_tree_walk": {
|
|
"gc_s": { "baseline": 0.103, "tolerance_pct": 10 },
|
|
"bump_s": { "baseline": 0.038, "tolerance_pct": 10 },
|
|
"rc_s": { "baseline": 0.095, "tolerance_pct": 10 },
|
|
"gc_over_bump": { "baseline": 2.71, "tolerance_pct": 8 },
|
|
"rc_over_bump": { "baseline": 2.50, "tolerance_pct": 8 },
|
|
"gc_rss_kb": { "baseline": 73260, "tolerance_pct": 5 },
|
|
"bump_rss_kb": { "baseline": 55208, "tolerance_pct": 5 },
|
|
"rc_rss_kb": { "baseline": 108956, "tolerance_pct": 5 }
|
|
},
|
|
"bench_closure_chain": {
|
|
"gc_s": { "baseline": 0.013, "tolerance_pct": 25 },
|
|
"bump_s": { "baseline": 0.007, "tolerance_pct": 25 },
|
|
"rc_s": { "baseline": 0.029, "tolerance_pct": 20 },
|
|
"gc_over_bump": { "baseline": 1.86, "tolerance_pct": 15 },
|
|
"rc_over_bump": { "baseline": 4.14, "tolerance_pct": 15 },
|
|
"gc_rss_kb": { "baseline": 13688, "tolerance_pct": 15 },
|
|
"bump_rss_kb": { "baseline": 15836, "tolerance_pct": 15 },
|
|
"rc_rss_kb": { "baseline": 39644, "tolerance_pct": 10 }
|
|
},
|
|
"bench_hof_pipeline": {
|
|
"gc_s": { "baseline": 0.134, "tolerance_pct": 10 },
|
|
"bump_s": { "baseline": 0.048, "tolerance_pct": 10 },
|
|
"rc_s": { "baseline": 0.136, "tolerance_pct": 10 },
|
|
"gc_over_bump": { "baseline": 2.79, "tolerance_pct": 8 },
|
|
"rc_over_bump": { "baseline": 2.83, "tolerance_pct": 8 },
|
|
"gc_rss_kb": { "baseline": 103788, "tolerance_pct": 5 },
|
|
"bump_rss_kb": { "baseline": 97448, "tolerance_pct": 5 },
|
|
"rc_rss_kb": { "baseline": 193640, "tolerance_pct": 5 }
|
|
},
|
|
"bench_compute_collatz": {
|
|
"gc_s": { "baseline": 0.057, "tolerance_pct": 12 },
|
|
"bump_s": { "baseline": 0.056, "tolerance_pct": 12 },
|
|
"rc_s": { "baseline": 0.056, "tolerance_pct": 12 },
|
|
"gc_over_bump": { "baseline": 1.02, "tolerance_pct": 10 },
|
|
"rc_over_bump": { "baseline": 1.00, "tolerance_pct": 10 },
|
|
"gc_rss_kb": { "baseline": 13624, "tolerance_pct": 15 },
|
|
"bump_rss_kb": { "baseline": 13860, "tolerance_pct": 15 },
|
|
"rc_rss_kb": { "baseline": 13880, "tolerance_pct": 15 }
|
|
},
|
|
"bench_list_sum_explicit": {
|
|
"gc_s": { "baseline": 0.139, "tolerance_pct": 10 },
|
|
"bump_s": { "baseline": 0.048, "tolerance_pct": 10 },
|
|
"rc_s": { "baseline": 0.152, "tolerance_pct": 10 },
|
|
"gc_over_bump": { "baseline": 2.89, "tolerance_pct": 8 },
|
|
"rc_over_bump": { "baseline": 3.14, "tolerance_pct": 8 },
|
|
"gc_rss_kb": { "baseline": 103772, "tolerance_pct": 5 },
|
|
"bump_rss_kb": { "baseline": 97636, "tolerance_pct": 5 },
|
|
"rc_rss_kb": { "baseline": 142424, "tolerance_pct": 8 }
|
|
}
|
|
},
|
|
|
|
"latency": {
|
|
"implicit_at_gc": {
|
|
"median_us": { "baseline": 96.4, "tolerance_pct": 15 },
|
|
"p99_us": { "baseline": 7130.0, "tolerance_pct": 20 },
|
|
"p99_9_us": { "baseline": 8131.2, "tolerance_pct": 25 },
|
|
"max_us": { "baseline": 8343.7, "tolerance_pct": 25 },
|
|
"p99_over_median": { "baseline": 73.92, "tolerance_pct": 20 }
|
|
},
|
|
"explicit_at_rc": {
|
|
"median_us": { "baseline": 213.9, "tolerance_pct": 15 },
|
|
"p99_us": { "baseline": 357.5, "tolerance_pct": 25 },
|
|
"p99_9_us": { "baseline": 404.1, "tolerance_pct": 25 },
|
|
"max_us": { "baseline": 413.0, "tolerance_pct": 25 },
|
|
"p99_over_median": { "baseline": 1.66, "tolerance_pct": 25 }
|
|
},
|
|
"implicit_at_rc": {
|
|
"median_us": { "baseline": 285.7, "tolerance_pct": 15 },
|
|
"p99_us": { "baseline": 407.1, "tolerance_pct": 20 },
|
|
"p99_9_us": { "baseline": 452.0, "tolerance_pct": 25 },
|
|
"max_us": { "baseline": 477.3, "tolerance_pct": 30 },
|
|
"p99_over_median": { "baseline": 1.43, "tolerance_pct": 20 }
|
|
}
|
|
}
|
|
}
|