-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
question about performance of at(...)
#210
Comments
Hi @samuelpmish , thank you for using phmap. I have a fix for you. You''ll be happy with the speed:
Here are the results I got:
|
Here is your updated benchmark PS: would you mind if I add it as an example in phmap? |
thanks for the update, that was what I was missing!
sounds good to me
you've figured me out, it's taken from a finite element project-- thanks again for the help! |
Oh, I just thought that your bench will be a bit faster if you reserve the size in your map:
|
Hi, I'm trying out this library for a project where I have a performance bottleneck on a piece of code that uses a
std::unordered_map
to renumber some indices:Of course
std::unordered_map
doesn't let you insert things in parallel, so every other part of the code is benefitting from 32 threads, but this one becomes a bottleneck because of the serial insertion step. When I time these two operations, I get (first timing is insertion, second is updating indices)So, the insertion can't benefit from multiple threads, but the update step can (~10x speedup).
When I try using
as a drop in replacement for
std::unordered_map<uint64_t, uint64_t>
, I get better insertion timesbut considerably worse access times in the update step.
Is this expected, or am I perhaps using the wrong kind of container (or configuring them with the wrong parameters)?
The complete sourcefile for this benchmark is available here.
Thank you
The text was updated successfully, but these errors were encountered: