Replies: 5 comments 5 replies
-
Yes, absolutely, |
Beta Was this translation helpful? Give feedback.
-
So I can assume, that find is many times faster in comparison ? I'm primarily using the phmap::node_hash_map in replacement for std::unordered_map. Generally, we have 24 threads running, each of it, with it's own map. I'm storing uint32 keys (ipv4 basically) w/ each key, linking to an object that's around 3 KB of size (We can expect up to 500K objects at peaks, and around 10k in lowest moments of usage). The idea, is to avoid time spent in "misses" for keys that doesn't exists, sometimes we may hit up to 40.000.000 (1.6M/thread) lookups/second, hence why my question. :) |
Beta Was this translation helpful? Give feedback.
-
Probably not many times faster in your use case, but faster.
Sounds good. Is each thread specialized for a IP subset? How is this subset determined? Do the threads look at all IPs and only process those matching the subset the specialize for? |
Beta Was this translation helpful? Give feedback.
-
I believe you can do much better and avoid duplicating entries. Even if memory usage is not an issue, this can improve memory locality and cache misses also improving performance. See the paragraph "Using the intrinsic parallelism of the parallel_flat_hash_map to insert values from multiple threads, lock free" there. |
Beta Was this translation helpful? Give feedback.
-
If you store only 500K objects max, you can use a bloom filter instead of a full 4 Gbit array, will be even faster and will allow to skip most queries for non-existing entries. |
Beta Was this translation helpful? Give feedback.
-
Hi, guys. In contrary to std::unordered_map, are the hashmaps provided by this library, currently using open addressing strategy to speed up the .find() lookup ?
Beta Was this translation helpful? Give feedback.
All reactions