From Jason Turner
Watch on YouTube

Summary

Jason explores C++17's Polymorphic Memory Resources (PMR) to significantly improve container performance. He demonstrates how to use std::pmr::monotonic_buffer_resource with standard containers to replace multiple heap allocations with a single stack allocation. Through benchmarks, he shows PMR containers can be up to 3.6x faster than their standard counterparts for node-based containers like std::list, and 2.3x faster for std::vector when creating multiple containers. The episode highlights how PMR addresses allocation costs in node-based containers like std::list, std::map, and std::unordered_map.

Resources

Tags