Chapter 10. Local Buffer Optimization
Not all design patterns are concerned with designing class hierarchies. For commonly occurring problem, a software design pattern is the most general and reusable solution, and, for those programming in C++, one of the most commonly occurring problems is inadequate performance. Among those, the problems of efficient memory management are some of the most frequent. Perforce, few general solutions, that is patterns. Patterns were developed to deal with these problems. In this chapter, we will explore one such pattern that addresses, in particular, the overhead of small, frequent memory allocations.
The following topics will be covered in this chapter:
- What is the overhead of small memory allocations, and how to measure it?
- What is the local buffer optimization, how does it improve performance, and how the improvements can be measured?
- When can the local buffer optimization pattern be used effectively?
- What are the possible downsides of and restrictions on...