Skip to content

Commit bb0927b

Browse files
committed
Step 6: Explain how to run the builds across Rubies locally
1 parent 4282e95 commit bb0927b

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/Gemfile.lock
44
/results/
55
/_site/
6+
/cross-ruby/

‎CONTRIBUTING.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,21 @@ docker compose run --rm -T --entrypoint ruby ruby_4.0 script/build_results_site.
122122
CI does the same after every run: the site is attached to the run as the
123123
`site-preview` artifact, and published to GitHub Pages from `main`.
124124

125+
Those results only compare idioms inside one Ruby: in CI each Ruby runs on its own machine.
126+
The site's "Across Rubies" view compares Rubies, so every build has to run on one machine.
127+
`script/run_cross_ruby.rb` (Ruby 3 on your machine, it calls Docker) does that, and runs the newest released MRI again after every 3 builds, so the site can show how steady the machine was.
128+
For example, two files on three builds:
129+
130+
```
131+
ruby script/run_cross_ruby.rb --files code/date/iso8601-vs-parse.rb,code/string/gsub-vs-tr.rb --builds ruby_3.4,ruby_3.4+yjit,ruby_4.0 --out cross-ruby
132+
docker compose run --rm -T --entrypoint ruby ruby_4.0 script/build_results_site.rb results _site --cross-ruby cross-ruby
133+
```
134+
135+
`ruby script/run_cross_ruby.rb --help` lists the options.
136+
The builds are the ones in the CI matrix (`.github/workflows/benchmarks.yml`), so a new Ruby added there and in `compose.yaml` is measured too, and once released it becomes both the reference and the Ruby the site opens on.
137+
CI runs every build on every file once a week, split over 6 machines (`.github/workflows/benchmarks-cross-ruby.yml`).
138+
On an Apple silicon Mac, leave out `ruby_2.1` and `jruby_9.1` (they run under emulation, so their numbers are not comparable) and `ruby_3.1+yjit` (Ruby 3.1's YJIT only exists on x86-64).
139+
125140
## Benchmarks that need a newer Ruby
126141

127142
CI runs every benchmark on every Ruby in `compose.yaml`, back to Ruby 2.1, and

0 commit comments

Comments
 (0)