On Fri, Nov 1, 2013 at 11:50 AM, Roy Stogner <roystgnr@ices.utexas.edu> wrote:

On Fri, 1 Nov 2013, John Peterson wrote:

unordered_map ends up somewhere between vector<pair> and map in terms of memory usage.


Interesting, thanks!

I assume that y label should read "megabytes", not "kilobytes?

Indeed.  I blame half-assed python hackers for that one...

For completeness, here's the memory results for all the main containers:


unordered_map memory usage is on par with std::list, which jives with the doubly-linked implementations discussed in the blog posting.

The biggest offender is actually unordered_set, although unordered_set<pair>, with the hash computed on the first member of the pair, is arguably something you would never do since maps exist.