perf(object): share ordinary property access and slot transactions - #19
Open
Eric-Song-Nop wants to merge 14 commits into
Open
perf(object): share ordinary property access and slot transactions#19Eric-Song-Nop wants to merge 14 commits into
Eric-Song-Nop wants to merge 14 commits into
Conversation
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ordinary own-data assignment previously scanned the prototype chain, materialized complete descriptors and round-tripped through Define. It now locates once, checks writable and updates the existing slot. The same storage owner supports selective Get, value-only Define, presence/enumerability and on-demand prototype traversal. Stacked on #18 (
perf/published-vm-execution,fec7519); implements the ordinary-property part of #16.Storage, ordinary algorithms and observable dispatch have separate responsibilities. Slot positions remain private to a short state borrow; only the needed value/getter/setter is rooted. Set preserves distinct receivers, Proxy completions and rejection identity, Array length conversion order, Arguments, VarRef/AutoInit and cross-runtime checks. Slot replacement retains new references before publication and rolls them back only on pre-publication failure, also fixing Atom ownership after old-edge cleanup failure.
Array and TypedArray regressions are addressed in this version. Genuine Array own slots and directly encoded dense elements share selective value/getter reads; Array misses and non-immediate dense indices retain the existing fallback. Array writes keep their special semantics. TypedArray bounds checking and byte access reuse one owned buffer token, obtained after value conversion for writes; no token is reused across callbacks. The pure bounds calculation is shared with existing state queries.
Performance uses matched Rust 1.94.1 ordinary release builds on a Ryzen 7 7840HS, CPU 2, with identical flags/features. #18's engine is built at documentation-only commit
c1dfce3; the final engine is1cc51bb. Times are fixed-work whole-process wall time, including startup, compilation, setup and teardown. No builds or tests overlap admitted timing.Ten rotating-order rounds compare #18, the previous #19 engine (
9c91663), and the updated engine:The complete 50 microbench + 8 real-program matrix and 38 object diagnostics each use five alternating rounds. The complete tables use the seven ten-round comparisons above for those sensitive cases. No additional over-3% rechecks were needed for the final matrix. Microbench geometric mean time change: -8.6%; real-program change: -12.7%. 8/8 real programs improved. No final matrix or diagnostic case was over 3% slower.
Five alternating rounds of hardware counters support the timing results:
Final-source validation (
1cc51bb, Rust 1.88.0):test262-hostand the pinned QuickJS oracle: 3,074 passed, 0 failed, 1 existing ignored. Includes the 14 ordinary-property regressions and new dense/slow Array, hole/prototype/receiver, named/Symbol/large-index, conversion resize/detach and shared-buffer coverage.1cc51bbfingerprint:e4f461c60faf9116313fcbcc6fc062d691f308ad4042e7f98d9a9154d21deea3.c52d4dcchanges only Markdown; Rust sources are byte-identical to tested1cc51bb. The source-tree fingerprint includessrc/engine/object/README.md, so the documentation head has fingerprint52ff05edb47af54c0a948544156fd7bb7f5509cb84d01096f9c42edbeac53a87; the executable receipts above intentionally identify the immutable tested engine commit.docs/ordinary-property-plan.md; final correctness checks use the repository's Rust 1.88.0 toolchain.Reproduce object diagnostics with
python3 scripts/benchmark/ordinary_workloads.py --output target/ordinary-diagnostics. Use that manifest ordocs/reports/data-structure-fixed-final.jsonwithscripts/benchmark/fixed.py, the plain before/after binaries and--cpu 2 --repeat 5(10 for rechecks). Build withscripts/benchmark/build.pyto record compiler, flags, commit and ELF hashes.Final receipts, raw stdout/stderr, distributions, counters and verification logs are retained locally under
target/property-regfix3-*; these are not public downloads. Before ELF SHA-256:66b89405a2a283816c5840fef3152a443bd96be2f0723a663198a15f32b0a765. After ELF SHA-256:4221d5aed8ab9df7f5c8a6992acc6562d6760b2dde9e3376d5f23cf0b4f594a3. The inline-only experiment was reverted. Intermediate dense-read versions exposed a named-property regression and were superseded; their timings are not used in these final tables.Complete 50 + 8 matrix: median [min–max], ms
Complete 38 object diagnostics: median [min–max], ms