perf(store): use FxHashMap/FxHashSet for traversal seen maps#5214
Open
iammdzaidalam wants to merge 1 commit intoboa-dev:mainfrom
Open
perf(store): use FxHashMap/FxHashSet for traversal seen maps#5214iammdzaidalam wants to merge 1 commit intoboa-dev:mainfrom
iammdzaidalam wants to merge 1 commit intoboa-dev:mainfrom
Conversation
Test262 conformance changes
Tested main commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5214 +/- ##
===========================================
+ Coverage 47.24% 59.80% +12.56%
===========================================
Files 476 582 +106
Lines 46892 63460 +16568
===========================================
+ Hits 22154 37953 +15799
- Misses 24738 25507 +769 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Closes #5213
This switches
HashMap/HashSettoFxHashMap/FxHashSetin the structured clone/store path (core/runtime/src/store/from.rsandto.rs).Problem
The store path uses standard collections for traversal bookkeeping (e.g.
SeenMap,ReverseSeenMap).These maps are keyed by internal identities (pointer-like values) and are hit a lot during deep or cyclic object traversal. Using the default hasher here is probably doing more work than needed.
Change
Replace those maps with
FxHashMap/FxHashSet.This only affects internal bookkeeping. There is no intended semantic change.
Benchmark
Ran a local benchmark using
boa_cliwith repeatedstructuredClone()on a deep cyclic object graph (10 rounds, release build).Notes
Test plan
cargo test -p boa_engine -p boa_runtimepasses