Subject: Re: [boost] Proposal: Monotonic Containers - Comparison with boost::pool, boost::fast_pool and TBB
From: Christian Schladetsch (christian.schladetsch_at_[hidden])
Date: 2009-06-19 21:59:13
> So, if Christian could run some tests where the allocations are reserved
> (quite literally for vector, but one would have to prepopulate other
> containers when using the standard allocator) and only *accesses* to those
> elements are measured.
Updated results for
are here http://tinyurl.com/m83vll for GCC and here
http://tinyurl.com/n9g8jv for MSVC.
TBB is faster than monotonic in one test on Win32, sort_list, which is
Monotonic also loses sort_list against boost::fast_pool by ~10%, but wins
others by multiple orders of magnitude.
Boost::pool and ::fast_pool also require explicit releasing of memory (*if*
you can actually do this, see note earlier about problems with rebind<> and
boost::fast/pool), so there is a strong case to be made for monotonic over
It is true that TBB and std:: are both general allocators, and hence are
doing much more work than monotonic. However, that is also why monotonic is
generally faster than either.
Caveat: Monotonic allocation was designed for small, short-lived containers
and works best in that case. While it does indeed scale, you will eventually
exhaust memory if you repeatedly resize a vector say, or continually add and
remove elements from a container using a monotonic allocator.