Skip to content

Perf: keep private GC scratch on the context allocator #119

Description

@chrisbbreuer

Parent: #44
Related: #62, #97, #116

Problem

The object-churn profile was dominated by young collection and sweep. Eight independent private contexts also showed process-level allocator syscalls and substantially worse GC wall time than one context. Every GC heap assigned collector scratch (mark_stack, barrier/weak buffers, and related temporary lists) to std.heap.page_allocator, a policy introduced for the concurrent-marker thread even though that requirement does not apply to private contexts.

Completed work

  • Select the unbudgeted host allocator for GC scratch only when engine threads, concurrent GC, and parallel GC are all disabled.
  • Keep std.heap.page_allocator for concurrent-marker, threaded-GIL, and parallel contexts.
  • Preserve allocator lifetime and the public heap-budget boundary.
  • Add a focused identity/lifetime regression test distinguishing the private, concurrent, and threaded paths.
  • Profile and run order-balanced exact-parent A/B measurements for direct, warmed eight-context, and cold eight-context object churn.
  • Publish the clean full matrix, raw evidence, benchmark guide, and README.

Result

Runtime: ab7b08fb (perf(gc): use host scratch for private contexts (#119))

Publication: 88bd1b00 (docs(bench): publish private scratch results (#119))

Against the frozen parent runner, seven-sample order-balanced A/B improved warmed eight-context object churn by 5.2% and 6.7%, cold by 10.8% and 30.1%, and direct by 16.2% and 1.6%. Checksums were exact. A matched 10-second candidate profile contained no sampled mmap/munmap frames, versus 76 matching call-tree entries in the parent profile.

The clean publication matrix passed all 1,540 sample/checksum/timing-floor validations. Full normal tests passed 768/768 with no leak; TSan passed 767 plus one expected soak skip with no failure, leak, or sanitizer report; the docs build produced all 24 pages.

The low-battery full matrix still has independent and shared object-churn losses, owned by #62/#97/#116. This issue is complete because its scoped allocator change passed every acceptance criterion; it does not claim to complete the parent performance program.

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