ReviewOS

zig-utils/zig-js

Perf: pass the interpreter heap directly to exact managed barriers

#77
Closed chris opened this 11 days ago ·
11 days ago

Parent: #62 Related: zig-utils/zig-gc#10, #76

Problem

The post-#76 object_churn profile still attributes 167 top-of-stack samples to thread-local lookup, while the fixed allocation loop already owns the executing Interpreter and its exact gc heap pointer. barrierExactManagedCellFrom unnecessarily rediscovers that same heap through active_heap once per replacement. The direct checkpoint remains about 1.9x behind JSC.

Scope

  • Change the strict managed barrier helper to take the interpreter heap capability explicitly.
  • Use vm.gc in the fixed-shape object-allocation loop.
  • Preserve the arena fallback and exact owner/child contract.
  • Do not change the tolerant barrier or broader thread-local allocation funnels.
  • Measure against fb6f8d8 with alternating fresh processes and exact checksums.
  • Revert and document if the change is neutral.

Acceptance

  • Focused GC/nursery quick-loop coverage passes.
  • object_churn checksum remains 1030552128.
  • Candidate wins a majority of pinned pairs with a meaningful median reduction.
  • Commit references this issue and is pushed to main as Chris without coauthors.
11 days ago

Rejected after measurement; no commit retained. Against fb6f8d8, seven alternating fresh-process pairs with three samples each produced only 4/7 pair wins. The all-sample median moved 231.931042 ms -> 232.596834 ms (-0.2871%), and median-of-process-medians moved 230.681375 ms -> 231.687709 ms (-0.4362%). Checksum 1030552128 matched in all 42 samples. The focused GC/nursery test passed, but the runtime result is neutral-to-negative, so the patch was fully reverted.

Sign in to comment on this issue.