Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: faster hasher for Ukeys #7287

Merged
merged 3 commits into from
Jul 23, 2024
Merged

perf: faster hasher for Ukeys #7287

merged 3 commits into from
Jul 23, 2024

Conversation

ahabhgk
Copy link
Collaborator

@ahabhgk ahabhgk commented Jul 23, 2024

Summary

  • perfer IdentifierMap<V> over FxHashMap<Identifier, V>
  • introduce UkeyHasher for faster hash calculate for Ukey
  • now Ukeys need there own COUNTER instead of using the same one (avoid u32 overflow)
  • merge rspack_identifier and rspack_database into rspack_collections

Further more, we can also apply this to HashMap<DependencyId, V>, etc.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack. labels Jul 23, 2024
@ahabhgk
Copy link
Collaborator Author

ahabhgk commented Jul 23, 2024

!bench

@rspack-bot
Copy link

rspack-bot commented Jul 23, 2024

📝 Benchmark detail: Open

Name Base (2024-07-23 26d1cb6) Current Change
10000_development-mode exec 2.25 s ± 22 ms 2.24 s ± 19 ms -0.04 %
10000_development-mode_hmr exec 699 ms ± 10 ms 689 ms ± 5.3 ms -1.44 %
10000_production-mode exec 2.84 s ± 38 ms 2.85 s ± 26 ms 0.15 %
arco-pro_development-mode exec 1.91 s ± 73 ms 1.93 s ± 83 ms 1.10 %
arco-pro_development-mode_hmr exec 434 ms ± 0.95 ms 433 ms ± 1.1 ms -0.31 %
arco-pro_production-mode exec 3.47 s ± 109 ms 3.48 s ± 83 ms 0.31 %
threejs_development-mode_10x exec 1.77 s ± 20 ms 1.77 s ± 23 ms -0.10 %
threejs_development-mode_10x_hmr exec 865 ms ± 6.6 ms 858 ms ± 6.8 ms -0.77 %
threejs_production-mode_10x exec 5.74 s ± 25 ms 5.74 s ± 35 ms -0.09 %

@ahabhgk ahabhgk changed the title perf: hasher for ukey perf: faster hasher for ukey Jul 23, 2024
@ahabhgk ahabhgk changed the title perf: faster hasher for ukey perf: faster hasher for Ukeys Jul 23, 2024
@ahabhgk ahabhgk requested a review from JSerFeng July 23, 2024 14:47
@ahabhgk ahabhgk enabled auto-merge (squash) July 23, 2024 15:02
@ahabhgk ahabhgk requested a review from h-a-n-a July 23, 2024 15:11
@ahabhgk ahabhgk merged commit 5392167 into main Jul 23, 2024
33 checks passed
@ahabhgk ahabhgk deleted the perf-hasher branch July 23, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants