Repository navigation
Distribute free candidates without a modulo per object - #140
Merged
Merged
Conversation
eightbitraptor
force-pushed
the
mvh-weak-proc-stride
branch
from
November 5, 2026 23:10
d81b049 to
a9a5892
Compare
add_obj_free_candidates_batch walked the whole batch once for every bucket and kept the objects where i % num_buckets == idx. Each flush of 128 candidates ran 128 * num_buckets modulo operations on the mutator thread. There is one bucket per GC worker, so the cost grew with the number of cores. In this commit we visit only the objects that belong to each bucket with skip(idx).step_by(num_buckets). Each object still goes to bucket i % num_buckets, and each flush visits every object once. On a c6i.metal with 64 GC workers, the ruby-bench headline geomean speedup with YJIT is 1.15x. With 1 GC worker there is no change.
eightbitraptor
force-pushed
the
mvh-weak-proc-stride
branch
from
November 6, 2026 18:28
a9a5892 to
61211cf
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
add_obj_free_candidates_batchwalked the whole batch once for every bucket and kept the objects wherei % num_buckets == idx.Each flush of 128 candidates ran
128 * num_bucketsmodulo operations on the mutator thread. There is one bucket per GC worker, so the cost grew with the number of cores.In this commit we visit only the objects that belong to each bucket with
skip(idx).step_by(num_buckets). Each object still goes to bucketi % num_buckets, and each flush visits every object once.This has a notable effect on headline benchmarks: