-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Test out a more lock-free hash map #138419
base: master
Are you sure you want to change the base?
Conversation
r? @Nadrieril rustbot has assigned @Nadrieril. Use |
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Test out a more lock-free hash map This tests out the more lock-free hash map from my [horde](https://crates.io/crates/horde) crate by using it as the default query map. The integration with `DynSync` / `DynSend` in this PR is unsound. Shards are no longer used for the map, which means all writes are behind a single lock. Reads are lock-free.
☔ The latest upstream changes (presumably #138414) made this pull request unmergeable. Please resolve the merge conflicts. |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (b73204a): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (secondary 5.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 779.458s -> 783.14s (0.47%) |
Local test with 8 threads / 8 cores:
Local test with 16 threads / 8 cores:
It does seem to reduce congestion even with the single write lock. |
I added a commit that uses this for type interning also. Local test with 16 threads / 8 cores for just the type interning change:
It does seem like sharding wasted quite a bit of memory. |
We can do another perf run if you’d like, but the conflicts would need to be resolved. |
This tests out the more lock-free hash map from my horde crate by using it as the default query map. The integration with
DynSync
/DynSend
in this PR is unsound.Shards are no longer used for the map, which means all writes are behind a single lock. Reads are lock-free.