Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

The Performance Price of Dynamic Memory in C++

CppNow via YouTube

Overview

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.

Syllabus

Introduction
System Allocators and Allocation Process
The problem of memory fragmentation
Custom allocator for STL containers: example
Solution: Don't allocate objects for communication
Why does the program's speed depend on the memory access patter?
Cache memories - data locality (example)
Cache memories - prefetcher (example)
Cache memories - cache line (example)
Summary: Memory Access Performance
Experiment with class size and member layout
Principles of cache-aware software design (1/4)
Array of values vs array of pointers
Array of pointer performance
Principles of cache-aware software design (2/4)
Small vs Large classes memory layout
Class Size, Data Layout and Performance
Principles of cache-aware software design (3/4)
Binary Tree Example Binary Tree a data structure used for tast lookup to check if the value is

Taught by

CppNow

Reviews

Start your review of The Performance Price of Dynamic Memory in C++

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.