Skip to content

Perf: beat JSC on array allocation, growth, traversal, and GC #47

Description

@chrisbbreuer

Parent: #44

Accepted baseline

The July 13, 2026 symmetric report measures:

  • direct single context: JSC leads the array kernel by 10.30x;
  • eight independent warmed contexts: JSC leads by 8.68x;
  • eight-lane independent scaling: zig-js reaches 5.48x versus JSC at 4.59x;
  • zig-js shared-realm scaling reaches 1.71x at eight lanes, exposing heavy allocation/GC contention despite remaining above 1.0x.

Evidence: harness c9f68e3; 616-sample report/README 2ebda1a.

Cross-cutting progress

Operand-stack fast path 22405c4 improved the array single-context median from 527.979 ms to 507.142 ms (1.041x) across seven alternating old/new process pairs with unchanged checksums. This is useful dispatch overhead reduction, but the much larger remaining JSC gap still requires array/allocation/GC profiling.

Investigation tracks

  • array literal/constructor and dense storage allocation
  • push capacity growth and element-kind checks
  • indexed load/store and length handling
  • nursery allocation, collection frequency, and promotion
  • shared allocator, GC phase, and safepoint contention

Acceptance criteria

  • Profile allocation, push, indexed traversal, barriers, and collector time separately.
  • Add allocation/GC counters to benchmark evidence without affecting timed runs.
  • Avoid repeated capacity growth for predictable dense pushes where semantics permit.
  • Preserve sparse arrays, holes, prototypes, accessors, proxies, length invariants, and OOM behavior.
  • Preserve precise tracing and pass focused GC/no-GIL/TSan validation.
  • Beat JSC in every fair direct and independent-context array row.
  • Retain greater than 1.0x shared-realm scaling at every reported lane count and materially improve the eight-lane result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions