bench: COMPARE=perl + life_bitpacked in run_baseline.sh#529
Merged
fglock merged 1 commit intofeature/refcount-perf-combinedfrom Apr 21, 2026
Merged
bench: COMPARE=perl + life_bitpacked in run_baseline.sh#529fglock merged 1 commit intofeature/refcount-perf-combinedfrom
fglock merged 1 commit intofeature/refcount-perf-combinedfrom
Conversation
Prerequisite for the §0 parity work (see dev/design/next_steps.md). Without side-by-side `jperl` vs `perl` numbers, perf changes are hard to evaluate and regressions (like the one currently shipped in PR #526) slip in unnoticed. Changes to dev/bench/run_baseline.sh: - COMPARE=perl: when set, each bench runs under both jperl and system perl (configurable via PERL=/path/to/perl); ratio + parity marker are emitted in the markdown summary. - life_bitpacked: if examples/life_bitpacked.pl exists, run it with `-r none -g 500` and parse "Cell updates per second" from stdout. Tracked as Mcells/s rather than wallclock seconds, so higher = faster (ratio is inverted: perl / jperl). - Dual output: baseline-<sha>.json (machine-readable) AND baseline-<sha>.md (human-readable table). - SKIP_LIFE=1 to opt out of the life bench (e.g. in CI where startup cost dominates short runs). - bash 3.2 compatible (macOS default) — no associative arrays. Add dev/bench/README.md documenting the harness, workloads, and link to the parity plan. Current baseline (PR #526 tip, BENCH_RUNS=1 sanity run, macOS M-series, perl 5.42): lexical 0.40× ✅ string 0.62× ✅ closure 1.39× ❌ regex 1.36× ❌ method 1.78× ❌ global 1.92× ❌ refcount_anon 3.82× ❌ eval_string 4.68× ❌ anon_simple 5.43× ❌ refcount_bless 6.67× ❌ life_bitpacked ~3.17× ❌ (6.47 Mcells/s vs 20.52) 3 runs per bench (default) amortizes JVM startup better than the single-run shown above. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Small prerequisite for PR #526's §0 perf work. Currently
dev/bench/run_baseline.shonly records jperl numbers, so the recently-discoveredlife_bitpackedregression (see #526) slipped in unnoticed. This PR upgrades the harness so every subsequent perf change is easy to evaluate against system perl.Changes
COMPARE=perl— when set, every benchmark runs under both jperl and system perl, and the output includes aratiocolumn and a parity marker (✅ ≤1.0×, ≈ ≤1.2×, ❌ >1.2×).examples/life_bitpacked.plintegrated into the baseline loop, tracked asMcells/s(higher = faster; ratio inverted).results/baseline-<sha>.json(machine) +results/baseline-<sha>.md(human).SKIP_LIFE=1to opt out when you just want the short benches.dev/bench/README.md— short doc covering how to run + what each workload measures.Current numbers (PR #526 tip, BENCH_RUNS=1 sanity run)
benchmark_lexicalbenchmark_stringbenchmark_regexbenchmark_closurebenchmark_methodbenchmark_globalbenchmark_refcount_anonbenchmark_eval_stringbenchmark_anon_simplebenchmark_refcount_blesslife_bitpackedA 3-runs default amortizes JVM startup so actual ratios are slightly better.
Merge plan
This targets
feature/refcount-perf-combinedrather than master so it can merge back into PR #526 before #526 lands. It's an isolated, zero-risk shell change (no behaviour change to the interpreter).Test plan
COMPARE=perl dev/bench/run_baseline.shproduces both JSON and markdownlife_bitpackedMcells/s extraction works/bin/bash3.2.57)Generated with Devin