Skip to content

Skip the write barrier when the plan has none - #138

Merged
eightbitraptor merged 1 commit into
mainfrom
mvh-skip-nobarrier-writebarrier
Nov 6, 2026
Merged

eightbitraptor merged 1 commit into
mainfrom
mvh-skip-nobarrier-writebarrier

Conversation

@eightbitraptor

Copy link
Copy Markdown
Member

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
eightbitraptor force-pushed the mvh-skip-nobarrier-writebarrier branch 2 times, most recently from 15bd4be to f8f2d42 Compare November 5, 2026 15:44
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
eightbitraptor force-pushed the mvh-skip-nobarrier-writebarrier branch from f8f2d42 to 347e3f9 Compare November 5, 2026 23:10
@eightbitraptor
eightbitraptor merged commit 2bbb0dc into main Nov 6, 2026
30 checks passed
@eightbitraptor
eightbitraptor deleted the mvh-skip-nobarrier-writebarrier branch November 6, 2026 08:02
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.

2 participants