Key Points

  • Flexibility trades off with speed. As the power and flexibility of memory management increases, execution speed decreases.

  • The global memory manager (implemented by new() and delete()) is general purpose and consequently expensive.

  • Specialized memory managers can be more than an order of magnitude faster than the global one.

  • If you allocate mostly memory blocks of a fixed size, a specialized fixed-size memory manager will provide a significant performance boost.

  • A similar boost is available if you allocate mostly memory blocks that are confined to a single thread. A single-threaded memory manager will help by skipping over the concurrency issues that the global new() and delete() must handle.

Get Efficient C++ Performance Programming Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.