In this post, we will see how to resolve Is the if-branch faster than the else branch? Question: I came across this very nice infographic which gives a rough estimation about the CPU-cylces used for certain operations. While studying I ...

Question: I’m writing some code in Java where, at some point, the flow of the program is determined by whether two int variables, “a” and “b”, are non-zero (note: a and b are never negative, and never within integer overflow ...

Question: Here is a piece of C++ code that shows some very peculiar behavior. For some strange reason, sorting the data (before the timed region) miraculously makes the loop almost six times faster. Without std::sort(data, data + arraySize);, the code ...

Question: I am reading this book by Fedor Pikus and he has some very very interesting examples which for me were a surprise. Particularly this benchmark caught me, where the only difference is that in one of them we use ...