Chris Baus

Memory pooling: It's about performance

I cranked out yet another version of my C++ pooled_list class. New version here: pooled_list.hpp As I mentioned before pooling reduces thread contention, the number of system calls made, and heap fragmentation. Hence, pooled structures can be significantly faster than heap allocated structures.

I did some performance testing, and I consistently get a 2x gain for inserts and erase operations with optimized g++ x86 Linux code over the standard list implementation. The performance gain results from removing global heap accesses. Instead of hitting the heap on every insert and erase, I make some pointer assignments which moves the node data from pool to the active list.

But don't take my word for it, try this test program: pooled_list_test.cpp. BTW, the test program has an example of how to use the boost microsec clock. It took me awhile to figure out what to include to get it work, but once I did, I found the interface quite nice.