Skip to content

Optimization#391

Merged
mame merged 2 commits intoruby:masterfrom
mame:optimization-2
Feb 25, 2026
Merged

Optimization#391
mame merged 2 commits intoruby:masterfrom
mame:optimization-2

Conversation

@mame
Copy link
Member

@mame mame commented Feb 25, 2026

No description provided.

mame added 2 commits February 25, 2026 05:44
Instead of eagerly computing the UTF-16 code units cache during parsing,
store the Prism source and defer computation until first access. This
avoids expensive String#encode calls when code_range positions are not
immediately needed.
Initialize @diagnostics as the frozen empty set instance to avoid
allocating a Hash for every AST node. Most nodes never receive
diagnostics, so the Set is only created on first use via add_diagnostic.
@mame mame enabled auto-merge (rebase) February 25, 2026 05:45
@mame mame merged commit 9959a28 into ruby:master Feb 25, 2026
7 checks passed
@mame mame deleted the optimization-2 branch February 25, 2026 05:52
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.

1 participant