Boost logo

Boost Users :

Subject: [Boost-users] [unordered] Merging unordered maps
From: Pete bartlett (pete_at_[hidden])
Date: 2014-05-29 12:24:02


I have a performance hotspot when merging a few unordered_maps of the same type into a master unordered_map (also of the same type)

Currently I am doing

Foreach( auto const& submap ,submaps )
  Master.insert( submap.begin() , submap.end() );

This seems to be somewhat wasteful because the insert is (I think) computing hashes that the submaps already "know".

Can I improve on this
  - without changing Boost?
  - without changing the boost interface, but changing the implementation (eg specialising the insert for certain iterator types)?
  - some more intrusive change?

If the second or third option, would the maintainer be willing to consider merging the change into Boost proper?

Thanks,
Pete


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net