The Performance Price of Dynamic Memory in C++
Explore the performance implications of dynamic memory usage in C++ through this comprehensive CppNow 2021 conference talk. Delve into the costs associated with allocating and deallocating memory, as well as the impact of memory access patterns on program speed. Learn about system allocators, memory fragmentation, and custom allocators for STL containers. Discover techniques to improve performance, including optimizing data arrangement and memory access patterns. Examine cache memories, data locality, prefetching, and cache line effects through practical examples. Gain insights into cache-aware software design principles, comparing array of values vs. array of pointers, and analyzing class size and member layout. Apply these concepts to real-world scenarios, such as optimizing binary tree implementations for faster lookups.