Skip to content

Perf: remove no-GIL scaling bottlenecks in the comparison workloads #49

Description

@chrisbbreuer

Parent: #44
Related: #47, #48

Goal

Make shared-realm parallel execution scale predictably without hiding contention behind comparisons to isolated JSC contexts. The fair matrix now uses independent-context rows to separate engine-local throughput from shared-GC/runtime contention.

Accepted baseline

At eight lanes the July 13, 2026 shared-realm scaling is:

  • arithmetic: 4.91x
  • properties: 4.78x
  • arrays: 1.71x
  • recursive Fibonacci: 0.79x

The independent zig-js steady-state geometric-mean scaling is 5.16x, while the shared-realm result is 2.37x. This isolates shared runtime/GC/call-path contention as a major target.

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

Acceptance criteria

  • Add per-run counters for mutator time, GC phases, safepoint waits, allocator contention, thread startup, and join time.
  • Profile arithmetic, properties, arrays, and recursion at 1/2/4/8 lanes.
  • Attribute every sub-1.0x or materially flattening scaling row to measured contention.
  • Reduce global locks and shared allocator traffic only with explicit ownership and tracing invariants.
  • Keep semantic no-GIL, lifecycle, mid-GC, broad-fuzz, and suppression-free TSan coverage green.
  • Shared-realm scaling exceeds 1.0x at every reported lane count for every workload.
  • Shared-realm throughput beats the independent JSC throughput row wherever the README makes that claim.

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