John Lakos demonstrates how local arena allocators can provide massive performance improvements over global new and delete in C++.
CppCon.org
—
Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2017
—
Are allocators worth the trouble? What situations merit their use? How are they applied effectually? What’s the performance impact? This practical talk by large scale C++ expert Dr. John Lakos demonstrates that having allocators in your tool box may lead to orders of magnitude speed improvements.
The runtime implications of the physical location of allocated memory is often overlooked, even in the most performance critical code. In this talk, we will examine how the performance of systems can degrade when using `new`/`delete` and `std::allocator` . We will contrast these global allocators, which allocate memory globally for a system, with local allocators that each allocate memory for a proper subset of objects in the system. We will also demonstrate how local allocators can reduce or entirely prevent the degradation seen in systems that rely on the global allocator. Six dimensions – fragmentability, allocation density, variation, locality, utilization, and contention – will be introduced to depict the potential for performance penalties and aid the listener in determining which local allocator will offer the best performance in their subsystems. Evidence will be presented that identifying these dimensions, and selecting a local allocator based upon them, can lead to *order-of-magnitude* reductions in run time compared to systems using a global allocator.
—
John Lakos: Bloomberg, Software Engineering Manager
John Lakos, author of Large-Scale C++ Software Design, serves at Bloomberg LP in New York City as a senior architect and mentor for C++ Software Development world-wide. He is also an active voting member of the C++ Standards Committee’s Evolution Working Group. Previously, Dr. Lakos directed the design and development of infrastructure libraries for proprietary analytic financial applications at Bear Stearns. For 12 years prior, Dr. Lakos developed large frameworks and advanced ICCAD applications at Mentor Graphics, for which he holds multiple software patents. His academic credentials include a Ph.D. in Computer Science ('97) and an Sc.D. in Electrical Engineering ('89) from Columbia University. Dr. Lakos received his undergraduate degrees from MIT in Mathematics ('82) and Computer Science ('81). His next book, entitled Large-Scale C++—Volume I: Process and Architecture, is anticipated in 2017.
—
Videos Filmed & Edited by Bash Films: BashFilms.com
Work at Hudson River Trading (HRT): tinyurl.com/safxfctf
---
Videos Filmed & Edited by Bash Films: BashFilms.com
Why it's here
1 person recommends this
What people say. Recommended as a foundational resource on custom allocators and optimizing memory allocation performance.
d
u/dist1llin r/rust • Recommends
On “What strategies/tools/methodologies do you use when improving performance?”
…f latency is a concern, make use of lock-free/wait-free algorithms. (Bottleneck: many things. Certainty: difficult to achieve, and highly workload dependent.)
- Make use of custom allocators that make favorable tradeoffs for your problem (Certainty: requires a bit of work gathering allocation statistics like frequency, object size, lifetime etc.) link to this video
- Reduce system calls, or find ways to batch them or make them asynchronous
There's millions more. It's just too much. I'll leave you at least with a link to Brendan's book https://www.brendangregg.com/systems-performance-2nd-edition-book.html…
On “Spotting and Avoiding Heap Fragmentation in Rust Apps”
Specialised allocators, like arenas, pools and bump allocators. You can do these in Rust but it's typically harder because they often go against Rust's ownership model and don't work nicely with Rust containers. There are RFCs for supplying custom allocators to containers and placement new but they are hard problems to solve in Rust and I think lower priority than many other things so not that much progress has happened there.
This is a good talk on the topic
link to this videolink to this video