Overview Alignment Preferred/Natural Alignment Padding Arrays Of Things Why Does This Matter? Types Of Memory Stack Heap Memory Architecture Virtual Memory Uniform And Nonuniform Memory Performance Cache Misses False Sharing Skipping The Details Show Me The Numbers Summary Overview The
Memory Management: An Introduction
Overview What Is This Do We Need Memory Management Prove It’s A Problem Prove ImPROVEments What Exactly Are We Solving Fix Causes, Not Symptoms Memory Usage Fragmentation Waste Performance The Care And Feeding Of Bugs Leaks Use-After-Free Double-free Overrun and
Optimizing C++ Compilation: The Trouble With Templates
tl;dr: Results! IntroBaseline Compile TimesReducing Include CostIdentifying Compilation CostIt’s a Problem of ScaleForward DeclarationDetermining What’s ExpensiveDeduplicating Duplicitous DuplicationEnter The DragonThe Final Code?Results!Oddities, Errors, and Errata Intro Templates are one of the most ubiquitous features of C++, allowing programmers to write
C++ Compilation: Fixing It
For fixing compile times, there is no magic bullet. It takes work and work takes time. Before you spend time reducing compile (and link) times, evaluate if it actually makes sense. If you spend more on making the changes than
C++ Compilation: Lies, Damned Lies, and Statistics
no, seriously, tl;dr… How the Test Works Optimizing the Test Reasonable Confidence Bias TL;DR Results by Compiler Results by C++ Standard Visual Studio 2015 Visual Studio 2017 clang 7.0.1 Heuristics In the first post, C++ Headers Are Expensive!, I posted
C++ Compilation: What’s Slowing Us Down?
The last post on how long it takes to include (not even use) and compile the standard C/C++ headers left a whole lot of people like: There were questions like “What about using an SSD?” “What about the file cache?”
Simplicity
I’m a big fan of simplicity. It’s easier to learn, understand, maintain, and optimize. It’s also easier to write for, debug, and handle errors. As such, I tend to think a lot about how we code in C and C++.
Function Call Tests
I did a quick test just to see what the cost of different methods of function calling are. Lots of people say “Soandso is more expensive” but I rarely see anyone quantify what “more expensive” means. These tests are just