Skip to content

Show --zjit-stats in the summary table#501

Merged
k0kubun merged 2 commits intoruby:mainfrom
k0kubun:zjit-stats-summary
Mar 26, 2026
Merged

Show --zjit-stats in the summary table#501
k0kubun merged 2 commits intoruby:mainfrom
k0kubun:zjit-stats-summary

Conversation

@k0kubun
Copy link
Member

@k0kubun k0kubun commented Mar 26, 2026

When --zjit-stats=stat1,stat2 is passed, add those stats as columns in the summary table in addition to printing per-iteration diffs. This generalizes the approach so any ZJIT stat can be surfaced in the summary without needing a dedicated flag per stat.

Example

$ ./run_benchmarks.rb lobsters --chruby 'before --zjit;after --zjit' --zjit-stats=code_region_bytes,zjit_alloc_bytes --no-sudo --warmup=1 --bench=1
...

before: ruby 4.1.0dev (2026-03-26T07:27:31Z master c5ab2114df) +ZJIT +PRISM [x86_64-linux]
after: ruby 4.1.0dev (2026-03-26T07:27:46Z zjit-lightweight-f.. a32ce82bf2) +ZJIT +PRISM [x86_64-linux]

--------  ------------  -----------------  ----------------  ------------  -----------------  ----------------  -------------  ------------
bench      before (ms)  code_region_bytes  zjit_alloc_bytes    after (ms)  code_region_bytes  zjit_alloc_bytes  after 1st itr  before/after
lobsters  959.9 ± 0.0%          9,244,672        14,301,972  956.8 ± 0.0%          9,990,144        15,289,608          0.988         1.003
--------  ------------  -----------------  ----------------  ------------  -----------------  ----------------  -------------  ------------

When --zjit-stats=stat1,stat2 is passed, add those stats as columns
in the summary table in addition to printing per-iteration diffs.
This generalizes the approach so any ZJIT stat can be surfaced in the
summary without needing a dedicated flag per stat.
@k0kubun k0kubun force-pushed the zjit-stats-summary branch from 71ab210 to e72dcc2 Compare March 26, 2026 21:54
Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
@k0kubun k0kubun merged commit 3ba83a7 into ruby:main Mar 26, 2026
10 checks passed
@k0kubun k0kubun deleted the zjit-stats-summary branch March 26, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants