Skip to content

Improve Ractor harness summary output#521

Open
eightbitraptor wants to merge 4 commits into
ruby:mainfrom
eightbitraptor:mvh-ractor-harness-improvements
Open

Improve Ractor harness summary output#521
eightbitraptor wants to merge 4 commits into
ruby:mainfrom
eightbitraptor:mvh-ractor-harness-improvements

Conversation

@eightbitraptor

Copy link
Copy Markdown
Member

The Ractor harness runs every benchmark across a range of Ractor counts in a single process. So you get multiple benchmark results for running with 0, 1, 2... n Ractors in addition to the main Ractor.

However the Ractor harness was compressing that information to fit into the same summary table format as generated by the default harness. This resulted in the extra information being averaged across all runs. This has the effect of hiding
the impact of adding Ractor contention to the benchmark.

(The Ractor harness also contained a bug where millisecond timings were being used in calculations that assumed seconds, making the Ractor timings look orders of magnitudes larger than the other benchmarks in the run).

This PR fixes both issues by reformatting the table to include rows for each Ractor count when benchmarks are run with the Ractor harness

Example output

Numbers are illustrative only, this is for demonstrating formatting only

master: ruby 4.1.0dev (2026-06-17T10:00:21Z master 45fd5d58f1) +YJIT +PRISM [x86_64-linux]
experiment: ruby 4.1.0dev (2026-06-26T10:18:28Z mvh-gc-profiler-im.. 380230ace8) +PRISM [x86_64-linux]
last_commit=wip benchmark

------------------  -------  -------------  ---------------  ------------------  -----------------
bench               ractors    master (ms)  experiment (ms)  experiment 1st itr  master/experiment
symbol-name-ractor        0   375.4 ± 0.6%     373.5 ± 0.4%               1.006              1.005
                          1   622.3 ± 0.4%     625.3 ± 0.4%               0.995              0.995
                          2  2271.9 ± 0.3%    2092.8 ± 2.7%               1.109              1.086
                          4  2846.4 ± 7.3%    3287.3 ± 1.0%               0.984              0.866
                          6  3667.9 ± 3.5%    3992.1 ± 0.3%               0.885              0.919
                          8  4653.0 ± 0.7%    4847.3 ± 1.7%               0.960              0.960
str_concat                0    44.0 ± 6.3%      91.6 ± 3.3%               0.503              0.481
                          1    42.7 ± 5.4%      93.8 ± 3.7%               0.444              0.455
                          2   39.4 ± 11.3%      91.1 ± 4.1%               0.441              0.432
                          4   52.2 ± 17.4%      96.1 ± 3.1%               0.494              0.543
                          6   50.5 ± 19.3%    104.3 ± 10.4%               0.628              0.484
                          8    59.5 ± 5.4%     139.0 ± 3.8%               0.400              0.428
------------------  -------  -------------  ---------------  ------------------  -----------------

Legend:
- experiment 1st itr: ratio of master/experiment time for the first benchmarking iteration.
- master/experiment: ratio of master/experiment time. Higher is better for experiment. Above 1 represents a speedup.

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.

1 participant