Skip to content

Precompute bytecode operand sizes - #81

Merged
chicoxyzzy merged 2 commits into
mainfrom
perf/lda-property-single-walk
Jul 30, 2026
Merged

Precompute bytecode operand sizes#81
chicoxyzzy merged 2 commits into
mainfrom
perf/lda-property-single-walk

Conversation

@chicoxyzzy

@chicoxyzzy chicoxyzzy commented Jul 29, 2026

Copy link
Copy Markdown
Owner

What changed

  • Generate a 256-byte operand-size table at comptime from the authoritative Op.spec() schema.
  • Inline Op.operandSize() as one indexed load instead of re-running instruction metadata and operand-layout classification at runtime.
  • Document that the table is derived cache data, not a second hand-maintained schema.

Why

ReleaseFast profiles attributed roughly 31% of Richards, 19% of DeltaBlue, and 22% of RayTrace samples to runtime operand-size metadata. Merged opcode-family handlers call this path on every execution even though the bytecode schema is immutable.

Impact

The serialized remote 12-pair A/B improved all six interpreter macros: Richards 0.582x, DeltaBlue 0.725x, Crypto 0.681x, RayTrace 0.748x, Navier-Stokes 0.765x, and Splay 0.849x, for a 0.720x geometric mean. The default production-tier geometric mean was 0.706x. Interpreter prop_access measured 0.576x, and the full micro suite reported no regression past the paired-run threshold. Dispatch counts and bytecode encoding are unchanged.

Validation

  • zig build test-fast
  • exhaustive Op: schema/table equality tests
  • full non-cached test262: 48,653 pass / 1,324 fail, 97.35% (exact main pass set)
  • independent code review: no findings
  • serialized remote 12-pair A/B, both tiers: no regressions

@chicoxyzzy
chicoxyzzy marked this pull request as ready for review July 29, 2026 23:50
@chicoxyzzy
chicoxyzzy merged commit 0d4da62 into main Jul 30, 2026
34 checks passed
@chicoxyzzy
chicoxyzzy deleted the perf/lda-property-single-walk branch July 30, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant