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…
In this post we try to answer the questions “what are premature optimizations?”
We investigate why software gets slower as new features are added or data set grows and what can you do about it.
We investigate the topic of premature optimizations, or more specifically, in what cases you want to think early about performance.
In this post we talk about how to write code that is both flexible and fast!
We talk about virtual functions, and how the performance of software with virtual functions depends on many factors: the cost of additional instructions, cache misses, branch prediction misses, instruction cache misses and compiler optimizations.
We are exploring how class size and layout of its data members affect your program’s speed
We talk about C++ and its weakness for temporary objects and excessive copying. We also give some tips on how to avoid them and make your program faster.
We investigate what is the best way to store polymorphic objects in a container for fast access
If your program uses dynamic memory, its speed will depend on allocation time but also on memory access time. Here we investigate how memory access time depends on the memory layout of your data structure. We also investigate ways to speed up your program by laying out your data structure optimally.