Skip to content

[pull] master from ruby:master#983

Merged
pull[bot] merged 9 commits intoturkdevops:masterfrom
ruby:master
May 4, 2026
Merged

[pull] master from ruby:master#983
pull[bot] merged 9 commits intoturkdevops:masterfrom
ruby:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 4, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

byroot and others added 9 commits May 4, 2026 17:03
Basically a port of c45f781 into ruby

It's quite effective at ~97% hit rate for me.
Speeds it up from ~6.77x slower to only 4.07x slower.

For the lexer `on_sp` it also gives a bit of an improvement:
1.04x slower to 1.10x faster

I guess the class may be universally useful but for now I just made it nodoc.

ruby/prism@3ad9db38fe
It's a small, somewhat hacky performance boost. Locations are lazy, by freezing the
result they don't have to be pack/unpacked redundantly.
This gives about a 4% speed boost.

Other changes are to not modify the frozen AST

ruby/prism@9e93bd6bd5
It was showing up in profiles.

So:
* Don't splat `KEYWORDS` (also did the same for `BINARY_OPERATORS`)
* Use `start_with?` if possible

Overall gives a ~5% speed boost

ruby/prism@d611aa9d11
It's the same code duplicated in 3 places.
By only storing shape offsets in the cache, we're able to still
match two equal objects that happen to be in different heaps, as
well as to validate the object is neither frozen nor complex.
@pull pull Bot locked and limited conversation to collaborators May 4, 2026
@pull pull Bot added the ⤵️ pull label May 4, 2026
@pull pull Bot merged commit a440f23 into turkdevops:master May 4, 2026
1 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants