Boost logo

Boost :

From: Darren Cook (darren_at_[hidden])
Date: 2003-05-06 19:33:39

>>Is there interest in a "SimplePool" class that is quicker and less flexible?
> You might look at boost/detail/quick_allocator.hpp

Thanks. Once I rememebered to disable threads it gave the quickest results
(included below for comparison). Are there plans to move this into the pool

I found one bug: if BOOST_QA_PAGE_SIZE is not defined, and the class size is
bigger than 512 bytes then items_per_page comes to zero:
     enum { items_per_page = 512 / size };

Is this a job for the Boost concept check library? E.g. assert that
items_per_page is at least 2.

I think it would be nice if items_per_page were a template parameter, so I
can specify it for each class.


* 2.74..2.79s for normal new/delete,
* 2.70..2.72s for MemoryPool1 (block size of 300)
* 2.69..2.76s for MemoryPool1 (block size of 10, ie. 29 block allocs)
* 2.71..2.73s for MemoryPool2 (block size of 300)
* 2.71..2.73s for MemoryPool2 (block size of 10, ie. 29 block allocs)
* 2.75..2.77s for Boost::Pool (using malloc/free; disabling threading has
no effect)
* 2.79..2.81s for Boost::quick_allocator (threading, 1Mb blocks)
* 2.68..2.70s for Boost::quick_allocator (no threads, 1Mb blocks)
* (throwing away highest/lowest time for each, 6-10 test runs for each)

Boost list run by bdawes at, gregod at, cpdaniel at, john at