Skip to content

Performance comparison

Arne Goedeke edited this page Apr 16, 2012 · 17 revisions

These performance comparisons were generated using test/test.cpp and compare GJAlloc, std::allocator, boost::fast_pool_allocator, FSBAllocator, challoc, rtAllocator and glibc malloc. The test allocates N blocks of size 32 and frees them afterwards.

The first graph shows average time spent in one alloc+free, the second one the memory overhead per individual block. Note that all allocators using pools of memory have a huge overhead when using only a few blocks. Asymptotically all allocators have a constant overhead per block.

The memory overhead is almost independent of the alloc/free pattern, as expected. challoc has page sizes that grow exponentially. This makes frees and the corresponding lookup very fast for random free. However, it leads to large increases in memory overhead (in these tests using almost twice as much memory as GJAlloc).

These benchmarks were compiled using gcc 4.5.4 with -O3 and run on an Intel i7.

Allocating and freeing linearly

Runtime

Linear

Memory Overhead

Linear_mem

Allocating and freeing randomly

Runtime

Random

Memory Overhead

Random_mem