You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Perf: service VM safepoints without generic object-churn fallback iterations #104
A fresh 10-second ReleaseFast sample of clean 24656d74, exact shared object_churn 8x100, shows these collapsed top-of-stack counts across the worker threads:
gc.allocObjectBatch: 5,759
Heap.headerForPayload: 5,574
Heap.create: 5,413
__ulock_wait2: 2,712
Heap.sweepPhaseLocked: 2,170
GcCellBacking.allocFn: 1,574
Heap.collectYoung: 1,299
GcCellBacking.freeFn: 65
The retained object-allocation quick loop accounts 61 VM steps per iteration and is bounded to the next 1,024-step safepoint. A 16-iteration batch consumes 976 logical steps. When fewer than 61 steps remain, the quick path returns null and the interpreter executes one complete generic iteration. That generic iteration uses unbatched Heap.create, tolerant barrier classification through headerForPayload, and parallel metadata locking. All eight workers repeatedly converge on that fallback around collection boundaries.
Direction
Allow an already-guarded, non-calling quick-loop iteration to cross at most one internal VM safepoint, then immediately service the crossed checkpoint from fully materialized frame/stack state before any next JS instruction. Preserve exact maximum-step behavior and do not allow arbitrary checkpoint skipping. Prefer a general quick-loop checkpoint handoff if it is safe for the other guarded loop plans.
Acceptance criteria
Never execute the generic loop body solely because less than one specialized iteration remains before a safepoint.
Service every crossed checkpoint immediately after the atomic specialized iteration, with live accumulator/IP/frame roots materialized.
2dac7aca — single-mutator fixed-shape allocation may finish one guarded 61-step iteration across a VM checkpoint, then uses the existing observable-step helper to service every crossed checkpoint from materialized accumulator/IP/frame roots.
Shared/concurrent-GC mode deliberately keeps the prior checkpoint bound; the prototype that enabled crossing there regressed exact shared 8x100 by 23.74% in the short run and was rejected.
ab386010 — refreshed the full report, all 1,540 raw samples, benchmark guide, and README from clean implementation commit 2dac7aca.
Leaving this issue open. The serial/independent slice is useful and published, but the acceptance criteria still require a shared-safe design, explicit immediately-before/at/after and near-max_steps boundary coverage, and shared profile evidence showing that the generic Heap.create/headerForPayload convoy is materially reduced.
5f891bc8 — shared/concurrent-GC fixed-shape allocation now finishes the guarded crossing iteration, services the crossed checkpoint from materialized VM state, and keeps the 17th iteration inside the original bulk allocation instead of opening a contended one-object batch. Error paths advance through the same observable-step helper so a logically earlier termination/GIL/GC checkpoint wins before the exception.
409d6a30 — refreshed the full generated report, all 1,540 raw samples, benchmark guide, and README from clean implementation commit 5f891bc8.
Matched 10-second profiles (exact baseline vs candidate):
Development A/B retained direct neutrality and improved shared 1/2/4/8 medians. The clean full publication shows, versus the previous full publication:
warmed independent 8x100: 505.387 -> 419.609 ms (+20.4% throughput)
cold independent 8x100: 463.413 -> 417.247 ms (+11.1% throughput)
shared 1x100: 377.316 -> 351.344 ms (+7.4% throughput)
shared 2x100: 741.069 -> 717.910 ms (+3.2% throughput)
shared 4x100: 2,316.414 -> 2,112.202 ms (+9.7% throughput)
shared 8x100: 9,789.216 -> 9,311.238 ms (+5.1% throughput)
direct: 148.758 -> 150.652 ms (-1.3% throughput), treated as ordinary cross-run/power variation because the direct allocation path is unchanged
Correctness/validation:
explicit first specialized iteration placement immediately before, exactly at, and immediately after a 1,024-step checkpoint
exact max_steps + 1 and stop-at-checkpoint coverage
quick-loop allocation/restricted/fallback errors now use observable checkpoint advancement
focused regular test 2/2 green
focused TSan 4/4 green, including real shared Thread workers
full units 763/763 green, no failures/skips/leaks
publication harness 7/7 green; exactly 1,540 raw samples
The implementation and documentation acceptance criteria are now covered. I am leaving the issue open until the new 409d6a30 CI run completes its TSan/threadfuzz gates; #97 remains open because shared eight-lane object churn still scales only 0.30x and needs the next allocator/GC optimization.
The checkpoint-crossing batch is complete in 5f891bc and documented in 409d6a3. Its focused regular and TSan real-Thread tests passed, the later full engine suite passed 764/764 with no skips/failures/leaks, and #105 built successfully on top of it. The latest full publication is 1391131. Closing this completed slice; remaining shared object-churn work stays tracked by #97 and #105.
Activity
perf(vm): keep object churn specialized across checkpoints (#104)
docs(bench): publish checkpoint optimization results (#104)
chrisbbreuer commentedon Jul 14, 2026
First retained slice shipped directly to
main:2dac7aca— single-mutator fixed-shape allocation may finish one guarded 61-step iteration across a VM checkpoint, then uses the existing observable-step helper to service every crossed checkpoint from materialized accumulator/IP/frame roots.ab386010— refreshed the full report, all 1,540 raw samples, benchmark guide, and README from clean implementation commit2dac7aca.Exact-parent
object_churnA/B (exact checksums):Fresh full publication from
2dac7aca:Validation:
ThreadworkersLeaving this issue open. The serial/independent slice is useful and published, but the acceptance criteria still require a shared-safe design, explicit immediately-before/at/after and near-
max_stepsboundary coverage, and shared profile evidence showing that the genericHeap.create/headerForPayloadconvoy is materially reduced.perf(vm): batch allocation across shared checkpoints (#104)
docs(bench): publish shared checkpoint batching results (#104)
chrisbbreuer commentedon Jul 14, 2026
Second retained slice shipped to
main:5f891bc8— shared/concurrent-GC fixed-shape allocation now finishes the guarded crossing iteration, services the crossed checkpoint from materialized VM state, and keeps the 17th iteration inside the original bulk allocation instead of opening a contended one-object batch. Error paths advance through the same observable-step helper so a logically earlier termination/GIL/GC checkpoint wins before the exception.409d6a30— refreshed the full generated report, all 1,540 raw samples, benchmark guide, and README from clean implementation commit5f891bc8.Matched 10-second profiles (exact baseline vs candidate):
Heap.create: 6,135 -> 1,257 samples (-79.5%)headerForPayload: 7,442 -> 1,899 samples (-74.5%)Development A/B retained direct neutrality and improved shared 1/2/4/8 medians. The clean full publication shows, versus the previous full publication:
Correctness/validation:
max_steps + 1and stop-at-checkpoint coverageThreadworkersThe implementation and documentation acceptance criteria are now covered. I am leaving the issue open until the new
409d6a30CI run completes its TSan/threadfuzz gates; #97 remains open because shared eight-lane object churn still scales only 0.30x and needs the next allocator/GC optimization.chrisbbreuer commentedon Jul 15, 2026
The checkpoint-crossing batch is complete in 5f891bc and documented in 409d6a3. Its focused regular and TSan real-Thread tests passed, the later full engine suite passed 764/764 with no skips/failures/leaks, and #105 built successfully on top of it. The latest full publication is 1391131. Closing this completed slice; remaining shared object-churn work stays tracked by #97 and #105.