镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Closed

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

  1. chrisbbreuer commented on Jul 14, 2026

    @chrisbbreuer
    MemberAuthor

    Landed on main in fb6f8d8, backed by zig-gc exact-managed barrier b9b5a8c (zig-gc#10). Seven alternating process pairs with three samples each beat cfed7bc in 7/7 pairs: overall median 254.840333 ms -> 232.842708 ms (8.6319% lower, 1.0945x throughput), with checksum 1030552128 in all 42 samples. Validation: focused GC/nursery quick-loop coverage, 757/757 unit tests with zero leaks, and 7/7 benchmark-harness tests.

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