Skip to content

perf: index core data structures and reclaim dynamic storage - #17

Open
Eric-Song-Nop wants to merge 48 commits into
perf/batch-builtin-initializationfrom
perf/indexed-data-structures
Open

perf: index core data structures and reclaim dynamic storage#17
Eric-Song-Nop wants to merge 48 commits into
perf/batch-builtin-initializationfrom
perf/indexed-data-structures

Conversation

@Eric-Song-Nop

@Eric-Song-Nop Eric-Song-Nop commented Sep 10, 2026

Copy link
Copy Markdown

Map/Set lookups copied and scanned whole record tables, and dynamic property, module and compiler operations repeatedly copied or searched entire layouts. This PR introduces indexed lookup, compact live storage and focused fast paths while preserving observable ordering, ownership, exceptions and QuickJS compatibility.

Stacked on #15 (perf/batch-builtin-initialization); addresses #16. The implementation is split into small commits, with the completed plan and maintenance entry points in the completed plan and maintenance guide.

  • Collections share SameValueZero key rules and non-owning indexes; deleted records are reclaimed without keeping tombstones for paused iterators. Long-string hash memoization is bounded and weak.
  • Existing property writes replace one slot. Ordinary objects and slow/holey Arrays share compact dictionary storage with separate insertion order. Sparse truncation batches layout work, integer keys avoid string conversion, and TypedArray keeps its distinct index semantics.
  • Module, scope, string-constant and source-coordinate indexes remove repeated scans. Flat-string operations, Arguments/RegExp publication and small reference-edge transactions avoid redundant intermediate work.
  • Numeric VM updates operate in place. Ordinary calls borrow the caller's argument window; callee frames remain owned, and cleanup covers Return, Throw and internal errors.

Validation on final engine fingerprint b61a54ac6ff4469d1223fba670782e8a49ac9a3b612a810037748ff70c46e568:

  • Complete workspace tests: 1952 engine tests and 943 CLI/oracle tests passed, with one existing ignored CLI test. Profiling, doc and Test262-host combinations passed.
  • Focused Test262: 6844/6844. Full vector: 102037 variants, 80032 runnable, 79982 passes and the same 50 known failures. Both full receipts differ only in engine fingerprint and reproduce the frozen hashes when that metadata is normalized. Frozen receipts are unchanged.
  • All 694 architecture mutation canaries rejected; boundary/tool tests, source layout, fixture/registry checks and all CI-pinned Rust 1.88 lint combinations passed. Native release and Node/WASM playground acceptance passed.
  • 396 scaling samples and 522 fixed microbench/V8 samples passed exact-output admission. At width 2048, integer Map takes 2968→78 ms, string Map 5606→91 ms, property deletion 4184→78 ms and holey-array churn 8564→75 ms. All eight fixed V8 suites improve by roughly 8–41%. Complete distributions, binary/workload identities and counter/profile evidence are in docs/reports/data-structure-*-final.*.

Tradeoffs remain explicit: collection ordering uses BTreeSet O(log n), with intermediate ordinary-operation regressions retained in its report; dictionary metadata has a space cost. Borrowed arguments measure essentially flat and do not introduce a frame pool. No local/TDZ/publication checks were removed. Both Oxide versions still time out at 90 seconds in the original combined adaptive V8 harness, so those runs supply no comparison score. Structural reclamation tests do not establish lower whole-application RSS.

@Eric-Song-Nop Eric-Song-Nop changed the title perf: implement indexed data structures and bounded storage operations perf: index core data structures and reclaim dynamic storage Sep 10, 2026
@Eric-Song-Nop
Eric-Song-Nop marked this pull request as ready for review September 10, 2026 19:38
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