Skip to content

Add splay GC benchmark ported from V8/WebKit#487

Merged
jhawthorn merged 1 commit intoruby:mainfrom
jhawthorn:splay
Mar 6, 2026
Merged

Add splay GC benchmark ported from V8/WebKit#487
jhawthorn merged 1 commit intoruby:mainfrom
jhawthorn:splay

Conversation

@jhawthorn
Copy link
Member

@jhawthorn jhawthorn commented Mar 5, 2026

This is a benchmark both WebKit and V8 have used to measure their GC.

CRuby seems to perform pretty badly at this particular benchmark, and with a very large standard deviation. Although Ruby 4.0 does seem reliably faster than 3.4.

I vibe-ported this as directly as possible. For the generate_payload being inserted I made all the intermediate nodes a PORO with the leaf node containing a hash, array, and interpolated string.

@jhawthorn jhawthorn requested a review from eightbitraptor March 5, 2026 21:24
@right = nil
end

def traverse(&block)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, good catch. The original has a teardown method to convert the tree back to a list and verify he result, but I don't think it's measured as part of the benchmark iterations.

@jhawthorn jhawthorn enabled auto-merge March 6, 2026 18:36
@jhawthorn jhawthorn merged commit 19b9ba2 into ruby:main Mar 6, 2026
11 checks passed
@jhawthorn jhawthorn deleted the splay branch March 6, 2026 19:21
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