Measuring C++ Allocator Performance

Here’s how the combined and system times look like as compared to the standard STL allocator:

Average system + user time, compared to std::allocator

Average system time, compared to std::allocator

As you can see, for the value type sizes tested, the size-based approach show definite performance improvements over the standard STL allocator. It even outperforms glibc’s own malloc/free optimizations for mid-range value type sizes. Larger value type sizes perform less well compared to heap_pool, because the size-based approach adds additional bookkeeping to heap_pool allocations.

Most surprising, though, is that the size-based approach seems to outperform the standard STL allocator more, the larger value sizes grow. Given that the majority of optimizations are for smaller sizes, that’s a nice extra — but really a tribute to glibc’s malloc/free optimizations rather than fhtagn!’s own code base.

Pages: 1 2 3 4 5

Comments are closed.

Copyright © 2007 - 2018 by the respective authors.
Permission to use the image of Great Cthulhu has kindly been granted by F. Launet/Goomi Studio.
Other content on this website is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.0 Germany License.
Creative Commons License

Blog directory