Skip to content

Perf: use the exact-managed barrier in object churn replacement #76

Description

@chrisbbreuer

Problem

The fixed object-allocation loop replaces a present dense array element with a freshly allocated managed object on every iteration. Its generic replaceDenseElement barrier classifies both exact GC payload pointers through zig-gc’s tolerant live-payload index, which remains visible in the object_churn profile.

Scope

  • Add a narrow exact-managed value barrier in gc.zig backed by zig-gc#10.
  • Add an explicitly prevalidated, exclusive dense replacement primitive that omits its own generic barrier.
  • Use that pair only in the isolated object-allocation quick loop when the active allocator is the GC heap; preserve the existing arena/generic path.
  • Keep the per-iteration restriction check and all loop bailout semantics unchanged.
  • Add focused coverage proving the quick loop still runs correctly in both arena and GC modes, including nursery collection.
  • Compare pinned alternating runs against cfed7bc5; land only if the exact-checksum benchmark shows a repeatable win.
  • Run the batched full suite only after a measured win.

Acceptance

  • Exact managed owner/child barrier preserves nursery and incremental invariants.
  • object_churn checksum remains 1030552128.
  • Candidate beats the pinned baseline across paired samples.
  • Commit references this issue and is pushed to main as Chris without coauthors.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions