Is it possible to speed-up concurrent_hash_map by using multiple concurrent_hash_maps which are bucketed by a primary hash.
We have around two million objects to store and 32 threads are accessing them. We created 64 concurrent_hash_maps and based on the key, used one of the map to insert and lookup objects. We expected significant speed gain compared to using one map but the insert and lookup time remained pretty much the same.
Any insight will be appreciated
In my opinion, external bucketing should not help significantly because tbb::concurrent_hash_map also uses the bucket-based approach internally. Therefore, tbb::concurrent_hash_map implements similar idea and external bucketing seems redundant. I am not sure that it is possible to speed it up easily without changing the algorithm.
Could you describe your algorithm that we can try to find another approach to optimize it? Have you tried Intel VTune Amplifier to find bottlenecks in your application?
Alex, at this moment it's just a test program to compare TBB with our in house solution which we plan to replace using TBB.
Can you comment on algorithm complexity of TBB and how does the performance of TBB changes as number of object grows. Maybe that could a reason that second level of bucketing had no significant impact on performance.