-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Revisit HashMap memory layout #36660
Comments
Here's a comparison but with both hashmaps in the crate (I was suspecting some code difference or cross crate optimization problem)
|
PR #36692 |
Can this issue be closed considering the PR was merged? |
Absolutely. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now the internal HashMap representation is 3 unziped arrays hhhkkkvvv, I'm experimenting with changing it to hhhkvkvkv (in further iterations kvkvkvhhh may allow inplace grow). A previous attempt is #21973
Code here https://github.com/arthurprs/hashmap2/tree/layout
The obvious drawbacks are: padding can be wasted between the key and value, keys() and values() iterations that can consume more cache. Strangely I can't reproduce the iterator regression in the benchmarks.
I fixed all problems I could find in the benchmarks making sure value is not
()
and that it's actually accessed by the lookup benchmarks. But hey, they're still microbenchmarks...@bluss I realized I was hijacking the other thread #36567. I'm sorry.
The text was updated successfully, but these errors were encountered: