Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost or Standard when there is the choice?
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2014-02-16 12:34:52

Niall Douglas <s_sourceforge <at>> writes:

> On 16 Feb 2014 at 13:04, Daniel James wrote:
> >
> > According to Joaquin's recent benchmarks the recent standard
> > implementations are generally faster than the boost implementation,
> > which IMO is how it should be. I'm looking forward to
> > Boost.Unordered's obsolescence.
> >
> >
> [...]
> Also, performance isn't everything, memory footprint is also very
> important. It's unfortunate that blog didn't show differences in
> unordered_map<> memory consumption. I'd warrant that Dinkumware's
> unordered_map<> is very, very good on memory footprint. For the other
> STLs, I wouldn't like to guess.

No practical measure was taken, but one can guess from the layout
of the different data structures as described in

The overhead (memory minus sizeof(value_type)) in words for a container
of N elments and B buckets is:

* Dinkum: 2B + 2N
* libstdc++: 1B + 2N (1B + 1N is hash is fast and does not throw)
* libc++: 1B + 2N
* Boost.Unordered
  - unique elements: 1B + 2N
  - duplicate elements: 1B + 3N
* Boost.MultiIndex: 1B + 2N

So, in fact Dinkumware and Boost.Unordered-duplicate are
the ones that use the most memory.

Joaquín M López Muñoz
Telefónica Digital

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at