Flat multi set operation costs

Dear list, In a project of mine I am using a sorted vector as a multimap. The point was that insert, delete and retrieval operations arrived in batches (lots of inserts, lots of retrieval, lots of deletes...) so I essentially saved time sorting the vector when a new kind of operation arrived. I recently noticed boost has the flat multiset implementation, so I was wondering do it follows the same idea? If it does I would be nice to kick-out some code and use the library for ease of maintenance. Your faithfully, Paolo

El 02/10/2014 18:42, Paolo Bolzoni escribió:
I recently noticed boost has the flat multiset implementation, so I was wondering do it follows the same idea? If it does I would be nice to kick-out some code and use the library for ease of maintenance.
Some optimizations, but not as fast as a hand-written sorted vector. Things can be optimized using back insertion + stable_sort but this requires additional temporary O(N) memory I would like to avoid when possible, or even offer a customization point for users that don't want to allocate temporary memory for sorting/merging. So the short answer is: not the optimizations you might need. Ion
participants (2)
-
Ion Gaztañaga
-
Paolo Bolzoni