[pull] master from ruby:master - #1438
Merged
Merged
Conversation
storage behind `PM_STRING_EMPTY` (ruby/prism#4228) Some places memcpy the source, and NULL there is undefined behaviour. Fixes https://bugs.ruby-lang.org/issues/22254 ruby/prism@d0b36ceb34
Keyword tracking only needs membership, so replace identity hashes with identity sets to avoid storing unused values. Add `rb_set_p` for the type assertion in `vm_check_keyword`. Add benchmarks for 31, 32 and 128 keyword parameters with sparse and dense dynamic defaults, using both direct keywords and keyword splats. The 31-parameter cases provide a bitmask-only control. Local arm64 macOS measurements show about 16-26% higher throughput with many omitted dynamic defaults at 32 and 128 parameters. Smaller differences remain noisy, including in the bitmask-only controls. The tracking container is created at call time, leaving IBF and `ISeq#to_a` unchanged. Verify IBF-loaded calls with the Integer refinement and colliding keyword indices from [Bug #22335].
Closes Shopify#1051 The LIR generated without stats is the same, but now the `LoadField` can be deduped. Same as #18251 but without moving the `xor` to the HIR. Generate HIR is now: ``` v31:CUInt64 = LoadField v29, :RBASIC_FLAGS@0x1040 v32:CUInt64 = LoadField v30, :RBASIC_FLAGS@0x1040 v33:StringExact = StringAppend v29, v30, recv_flags: v31, other_flags: v32 ``` Compared with: ``` v31:StringExact = StringAppend v29, v30 ``` ### Benchmark ``` before: ruby 4.1.0dev (2026-09-17T02:33:06Z :detached: e6ec155) +PRISM [arm64-darwin25] after: ruby 4.1.0dev (2026-09-17T03:27:34Z :detached: fc9a90e) +PRISM [arm64-darwin25] ---------- ------------- ------------- ------------- ------------ bench before (ms) after (ms) after 1st itr before/after lobsters 636.7 ± 5.0% 631.6 ± 2.6% 0.999 1.008 railsbench 1175.6 ± 1.3% 1171.6 ± 1.3% 0.978 1.003 str_concat 41.7 ± 2.4% 42.3 ± 3.4% 1.006 0.984 ---------- ------------- ------------- ------------- ------------ Legend: - after 1st itr: ratio of before/after time for the first benchmarking iteration. - before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup. ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )