Repository navigation
Skip the write barrier when the plan has none - #138
Merged
Merged
Conversation
peterzhu2118
approved these changes
Nov 4, 2026
eightbitraptor
force-pushed
the
mvh-skip-nobarrier-writebarrier
branch
2 times, most recently
from
November 5, 2026 15:44
15bd4be to
f8f2d42
Compare
rb_gc_impl_writebarrier and rb_gc_impl_writebarrier_remember looked up the Ractor cache and called into Rust for every store, even for Immix, MarkSweep and NoGC, whose barrier is NoBarrier and does nothing. Lobsters runs about 920k barriers per iteration. In this commit we read the plan's barrier once in objspace_init through a new mmtk_plan_has_write_barrier, and return before the Ractor cache lookup and the FFI call when it is NoBarrier. StickyImmix keeps its object barrier.
eightbitraptor
force-pushed
the
mvh-skip-nobarrier-writebarrier
branch
from
November 5, 2026 23:10
f8f2d42 to
347e3f9
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.
rb_gc_impl_writebarrierandrb_gc_impl_writebarrier_rememberlooked up the Ractor cache and called into Rust for every store, even forImmix,MarkSweepandNoGC, whose barrier isNoBarrierand does nothing. Lobsters runs about 920k barriers per iteration.In this commit we read the plan's barrier once in
objspace_initthrough a newmmtk_plan_has_write_barrier, and return before the Ractor cache lookup and the FFI call when it isNoBarrier.StickyImmixkeeps its object barrier.