Skip to content

Support running Spinel as a benchmark target - #540

Merged
k0kubun merged 2 commits into
ruby:mainfrom
k0kubun:spinel-harness
Oct 9, 2026
Merged

k0kubun merged 2 commits into
ruby:mainfrom
k0kubun:spinel-harness

Conversation

@k0kubun

@k0kubun k0kubun commented Oct 2, 2026

Copy link
Copy Markdown
Member

This PR adds support to run spinel on ruby-bench.

git clone https://github.com/matz/spinel
cd spinel
make deps
make
make install PREFIX=/opt/rubies/spinel
$ ./run_benchmarks.rb str_concat --chruby 'zjit::after --zjit;spinel' --warmup=10 --bench=10 --no-sudo
Running benchmark "str_concat" (1/1)
+ setarch x86_64 -R taskset -c 6 /opt/rubies/after/bin/ruby --zjit -I harness /home/k0kubun/src/github.com/ruby/ruby-bench/benchmarks/str_concat.rb
ruby 4.1.0dev (2026-10-02T21:46:24Z master 5b6f593531) +ZJIT +PRISM [x86_64-linux]
itr:   time
 #1:   26ms
 #2:   20ms
 #3:   22ms
 #4:   17ms
 #5:   17ms
 #6:   22ms
 #7:   21ms
 #8:   16ms
 #9:   16ms
#10:   17ms
#11:   18ms
#12:   17ms
#13:   17ms
#14:   16ms
#15:   21ms
#16:   17ms
#17:   18ms
#18:   22ms
#19:   21ms
#20:   19ms
ZJIT stats:
code_region_bytes:          8,192
zjit_alloc_bytes:          20,500
compile_time               1.10ms
profile_time               0.02ms
gc_time                    0.02ms
invalidation_time          0.00ms
RSS: 31.6MiB
MAXRSS: 95.2MiB
RSS sampled (n=10): median 80.1MiB ± 15.2MiB (MAD), range [41.5, 95.3]MiB
Average of last 10, non-warmup iters: 19ms
Running benchmark "str_concat" (1/1)
+ setarch x86_64 -R taskset -c 6 /opt/rubies/spinel/bin/spinel -E -I harness /home/k0kubun/src/github.com/ruby/ruby-bench/benchmarks/str_concat.rb
spinel 4.0.7 (2026.09.12+4635 revision 3523c3655) [x86_64-linux]
itr:   time
 #1:   10ms
 #2:    8ms
 #3:    8ms
 #4:    8ms
 #5:    8ms
 #6:    9ms
 #7:    9ms
 #8:    8ms
 #9:    8ms
#10:    8ms
#11:    8ms
#12:   10ms
#13:    8ms
#14:    8ms
#15:    8ms
#16:    8ms
#17:    9ms
#18:    8ms
#19:    8ms
#20:   10ms
RSS: 18.2MiB
Average of last 10, non-warmup iters: 8ms
Total time spent benchmarking: 2s

zjit: ruby 4.1.0dev (2026-10-02T21:46:24Z master 5b6f593531) +ZJIT +PRISM [x86_64-linux]
spinel: spinel 2026.09.12+4635 (3523c3655) [gcc 13.3.0 (cc)]

----------  ------------  -----------  --------------  -----------
bench          zjit (ms)  spinel (ms)  spinel 1st itr  zjit/spinel
str_concat  19.0 ± 10.7%   8.9 ± 9.6%           2.514        2.125
----------  ------------  -----------  --------------  -----------

@k0kubun
k0kubun requested a review from a team October 2, 2026 22:40
Comment thread harness/loader.rb Outdated

@eregon eregon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@k0kubun
k0kubun merged commit b784e71 into ruby:main Oct 9, 2026
10 checks passed
@k0kubun
k0kubun deleted the spinel-harness branch October 9, 2026 18:31
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.

3 participants