Commit 30e7207f

30e7207f703fMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 1 file · ~1 modified

Description

docs: refresh benchmark table after string-length cache landings

The two recent runtime patches reshape the table noticeably:

  • json_parse moves from 296 ms (0.93x vs YJIT, the only cell where YJIT was winning) to 41 ms (6.7x vs YJIT).
  • huffman: 17 ms -> 7 ms (3.8x -> 9.1x). Now the top of the data structures group instead of the bottom.
  • template engine: 275 ms -> 170 ms (2.6x -> 4.3x).
  • fasta: 3 ms -> 2 ms; splay 15 ms -> 14 ms; fib 16 ms -> 15 ms.
  • Most other cells move by 1 ms or stay put (noise within the best-of-three protocol).

Geometric mean across the 28 benchmarks: 6.8x -> 7.8x vs YJIT. The trailing paragraph drops the "json_parse is the YJIT win" line (no longer true) and now flags tarai / tak as the remaining cells where YJIT lands within 2-3x of Spinel.

Closes #599

Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]

Details

Commit
30e7207f703f
Parent
5daff9a11a85

README.mdmodifiedView file

@@ -120,7 +120,7 @@
120120 ## Benchmarks
121121
122122 384 tests pass. 52 benchmarks pass.
123-Geometric mean: **~6.8x faster** than Ruby 4.0.4 with `--yjit` across
123+Geometric mean: **~7.8x faster** than Ruby 4.0.4 with `--yjit` across
124124 the 28 benchmarks below. Baseline is CRuby 4.0.4 (stable), run with
125125 `--disable-gems` and with `--yjit` for the JIT column. Each timing is
126126 the best of three wall-clock runs; sub-10 ms cells are dominated by
@@ -130,44 +130,44 @@
130130
131131 | Benchmark | Spinel | Ruby 4.0.4 | + YJIT | Speedup vs YJIT |
132132 |---|---|---|---|---|
133-| mandelbrot | 24 ms | 1_318 ms | 1_346 ms | 56.1x |
134-| nqueens | 9 ms | 310 ms | 309 ms | 34.3x |
135-| matmul | 9 ms | 300 ms | 301 ms | 33.4x |
136-| life (Conway's GoL) | 23 ms | 865 ms | 495 ms | 21.5x |
137-| partial_sums | 79 ms | 1_313 ms | 1_303 ms | 16.5x |
138-| sieve | 25 ms | 407 ms | 408 ms | 16.3x |
139-| sudoku | 5 ms | 102 ms | 53 ms | 10.6x |
133+| mandelbrot | 24 ms | 1_339 ms | 1_340 ms | 55.8x |
134+| nqueens | 9 ms | 312 ms | 311 ms | 34.6x |
135+| matmul | 9 ms | 302 ms | 303 ms | 33.7x |
136+| life (Conway's GoL) | 23 ms | 861 ms | 497 ms | 21.6x |
137+| partial_sums | 80 ms | 1_324 ms | 1_310 ms | 16.4x |
138+| sieve | 25 ms | 406 ms | 409 ms | 16.4x |
139+| sudoku | 6 ms | 103 ms | 54 ms | 9.0x |
140140 | fannkuch | 2 ms | 15 ms | 15 ms | 7.5x |
141-| ackermann | 9 ms | 344 ms | 59 ms | 6.6x |
142-| fib (recursive) | 16 ms | 535 ms | 95 ms | 5.9x |
143-| fasta (DNA seq gen) | 3 ms | 14 ms | 15 ms | 5.0x |
144-| tarai | 27 ms | 399 ms | 69 ms | 2.6x |
145-| tak | 35 ms | 497 ms | 82 ms | 2.3x |
141+| fasta (DNA seq gen) | 2 ms | 14 ms | 14 ms | 7.0x |
142+| ackermann | 9 ms | 343 ms | 60 ms | 6.7x |
143+| fib (recursive) | 15 ms | 538 ms | 95 ms | 6.3x |
144+| tarai | 28 ms | 400 ms | 70 ms | 2.5x |
145+| tak | 34 ms | 502 ms | 82 ms | 2.4x |
146146
147147 ### Data Structures & GC
148148
149149 | Benchmark | Spinel | Ruby 4.0.4 | + YJIT | Speedup vs YJIT |
150150 |---|---|---|---|---|
151-| so_lists | 35 ms | 483 ms | 303 ms | 8.7x |
152-| rbtree (red-black tree) | 21 ms | 520 ms | 114 ms | 5.4x |
153-| splay tree | 15 ms | 177 ms | 64 ms | 4.3x |
154-| binary_trees | 5 ms | 36 ms | 20 ms | 4.0x |
155-| huffman (encoding) | 17 ms | 63 ms | 64 ms | 3.8x |
156-| gcbench | 516 ms | 3_449 ms | 1_757 ms | 3.4x |
157-| linked_list | 67 ms | 299 ms | 224 ms | 3.3x |
151+| huffman (encoding) | 7 ms | 63 ms | 64 ms | 9.1x |
152+| so_lists | 35 ms | 485 ms | 299 ms | 8.5x |
153+| rbtree (red-black tree) | 20 ms | 521 ms | 113 ms | 5.6x |
154+| splay tree | 14 ms | 179 ms | 65 ms | 4.6x |
155+| binary_trees | 5 ms | 36 ms | 19 ms | 3.8x |
156+| linked_list | 71 ms | 306 ms | 236 ms | 3.3x |
157+| gcbench | 553 ms | 3_455 ms | 1_783 ms | 3.2x |
158158
159159 ### Real-World Programs
160160
161161 | Benchmark | Spinel | Ruby 4.0.4 | + YJIT | Speedup vs YJIT |
162162 |---|---|---|---|---|
163-| str_concat | 1 ms | 10 ms | 11 ms | 11.0x |
164-| ao_render (ray tracer) | 103 ms | 3_015 ms | 1_125 ms | 10.9x |
163+| ao_render (ray tracer) | 103 ms | 3_033 ms | 1_122 ms | 10.9x |
164+| str_concat | 1 ms | 10 ms | 10 ms | 10.0x |
165165 | bigint_fib (1000 digits) | 1 ms | 10 ms | 10 ms | 10.0x |
166+| json_parse | 41 ms | 413 ms | 275 ms | 6.7x |
166167 | pidigits (bigint) | 2 ms | 10 ms | 10 ms | 5.0x |
167-| csv_process | 250 ms | 1_046 ms | 922 ms | 3.7x |
168-| io_wordcount | 27 ms | 109 ms | 99 ms | 3.7x |
169-| template engine | 275 ms | 1_013 ms | 713 ms | 2.6x |
170-| json_parse | 296 ms | 413 ms | 276 ms | 0.93x |
168+| template engine | 170 ms | 1_020 ms | 723 ms | 4.3x |
169+| io_wordcount | 27 ms | 107 ms | 100 ms | 3.7x |
170+| csv_process | 255 ms | 1_050 ms | 924 ms | 3.6x |
171171
172172 A few notes on what YJIT does and doesn't change. On some integer-loop
173173 workloads (mandelbrot, nqueens, matmul, partial_sums, sieve) YJIT's
@@ -175,9 +175,9 @@
175175 is bound by integer / float operations that the interpreter already
176176 runs at native speed. On call-heavy code (ackermann, fib, tarai, tak,
177177 rbtree) YJIT gives a real 4-6x lift, but Spinel still wins by ahead-
178-of-time specialization. `json_parse` is the one win for YJIT: its
179-inner loop is dominated by `String` method dispatch that YJIT inlines
180-well, and Spinel's polymorphic-receiver path costs about 7% extra.
178+of-time specialization. The two YJIT-only weak spots remaining are
179+`tarai` and `tak`, where YJIT inlines the recursive call site so well
180+that Spinel's compiled C only beats it by ~2.4x.
181181
182182 ## Supported Ruby Features
183183