We investigate the secret connection between class layout and software performance. And of course, how to make your software faster.
All posts in Performance
Horrible Code, Clean Performance
A short tale of how horrible code yields clean performance.
Decreasing the Number of Memory Accesses: The Compiler’s Secret Life 2/2
We investigate memory loads and stores that the compiler inserts for us without our knowledge: “the compiler’s secret life”. We show that these loads and stores, although necessary for the compiler are not necessary for the correct functioning of our program. And finally, we explain how you can improve the performance of your program by removing them.
Decreasing the Number of Memory Accesses 1/2
In this post, we are investigating a few common ways to decrease the number of memory accesses in your program.
Frugal Programming: Saving Memory Subsystem Bandwidth
We investigate techniques of frugal programming: how to program so you don’t waste the limited memory resources in your computer system.
Loop Optimizations: interpreting the compiler optimization report
We introduce compiler optimization report, a useful tool if you wish to speed up your program by looking at what the compiler failed to optimize.
For Software Performance, the Way Data is Accessed Matters!
In our experiments with the memory access pattern, we have seen that good data locality is a key to good software performance. Accessing memory sequentially and splitting the data set into small-sized pieces which are processed individually improves data locality and software speed. In this post, we will present a few techniques to improve the…
What is faster: vec.emplace_back(x) or vec[x] ?
When we need to fill std::vector with values and the size of vector is known in advance, there are two possibilities: using emplace_back() or using operator. For the emplace_back() we should reserve the necessary amount of space with reserve() before emplacing into vector. This will avoid unnecessary vector regrow and benefit performance. Alternatively, if we…
When an instruction depends on the previous instruction depends on the previous instructions… : long instruction dependency chains and performance
In this post we investigate long dependency chains: when an instruction depends on the previous instruction depends on the previous instruction… We want to see how long dependency chains lower CPU performance, and we want to measure the effect of interleaving two dependency chains (by interleaving two operations) reflects on software performance. Operations with long…
The memory subsystem from the viewpoint of software: how memory subsystem affects software performance 2/3
We continue the investigation from the previous post, trying to measure how the memory subsystem affects software performance. We write small programs (kernels) to quantify the effects of cache line, memory latency, TLB cache, cache conflicts, vectorization and branch prediction.