Repository navigation
perf(heap): decide the write barrier with one Gen2 lookup - #5410
harivansh-afk wants to merge 1 commit into
Conversation
Minor collections trace Gen0 and Gen1 together, so a card is only ever needed for a Gen2 container that receives a reference from outside Gen2; mark_card_for_ptr already ignored every other container. The barrier still classified both sides fully: up to four chunk scans, then a fifth in mark_card_for_ptr to find the card. Check the container's Gen2 location first and reuse it for the card. A young container, the common case, now costs one Gen2 scan. Same cards are marked as before: container in Gen2 and value in CompileTime, Gen0 or Gen1. conservative_write_barrier calls mark_card_for_ptr directly for the same reason.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Comment |
⏭️ Performance benchmarks were skippedPerf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to To run them on this PR, do any of the following, then push a commit (or re-run CI):
|
Binary size checks failed❌ 2 violations · ✅ 1 passed
Details & how to fixViolations:
Add/update baselines:
[artifacts.bridge_wasm]
file_bytes = 27365333
gzip_bytes = 8029812
[artifacts.packed-program]
file_bytes = 41368224
gzip_bytes = 16867680Generated by |
|
Closing: superseded by the shared-runtime consolidation tracked from #5566. Branch kept for reference. |
TLDR
Stacked on #5409 (wb-2). Only Gen2 has cards, because minor collections trace Gen0 and Gen1 together.
mark_card_for_ptralready ignored every other container. The barrier still classified both sides fully: up to four chunk scans, then a fifth inmark_card_for_ptrto find the card. Most containers are young, and a young container is the worst case: every scan runs to the end and misses.How
write_barrier: look up the container's Gen2 location first. If it's in Gen2 and the value isn't, mark the card at that location. A young container costs one Gen2 scan.conservative_write_barriercallsmark_card_for_ptrdirectly.locate_in_gen2,mark_card_at.Results (wb-2 + wb-3 vs #5264 at
19f2ae2328, 10 interleaved rounds)* 20-trial rerun; the first 10-trial run read 0.97× / 0.96× with a ~25% trial spread.
bench-x86-v1.lockinstruction, not an outlined call.generation_ofno longer appears.Measurements:
instrumentation/measurements/2026-10-25-write-barrier-ab-{spark,x86,x86-rerun}/.