Subscribe to my mailing list, support me on Patreon or by PayPal donation.

Here is my curated list of HW and SW rules of thumb, fun facts and quotes about performance of the programs. It is not an April fool’s day joke, at least there was no intention to fool anybody :) .

Basic blocks are usually 5 instructions on average.

Branches occur every 6th instruction.

Average ILP (Instruction Level Parallelism) in the general-purpose SW is 2. (by Ivan Godard in one of his talks about the Mill CPU architecture).

90% of execution runs on 25 opcodes (by Jim Keller in this interview timestamp: 6:20)

90% of the execution time of a program is spent executing 10% of the code. (source: wikipedia)

Before 2008 all instructions were executed on the same frequency. Now technologies like Intel Turbo Boost and AMD Turbo Core allow to change frequency on the fly.

If cache size is doubled, miss rate usually drops by a factor of sqrt(2) .

. Modern CPUs can correctly predict outcomes of 99% of the branches.

The bigger the core count of CPU the lower its frequency.

Modern superscalar CPU tries to find parallelism dynamically, but it is limited on what it can see by its branch predictor.

“Flat profiles are dying. Already dead for most programs. Larger and larger fraction of code runs freezingly cold, while hot spots run hotter. … By the late 1990s for even performance sensitive code, optimizing compilers exceeded the performance of human experts. … We come so close to optimal on most architectures that we can’t do much more without using NP complete algorithms instead of heuristics. We can only try to get little niggles here and there where the heuristics get slightly wrong answers. … We found ourselves always running up against the same problem: the compiler needs to be in a dialog with the programmer; it needs to know properties of the data, and whether certain cases can arise, etc. And we couldn’t think of a good language in which to have such a dialog.” (from “The death of optimizing compilers”).

0.75% CPU utilization is not idle system and may wake up CPU.

Other interesting rules of thumbs and quotes:

Add your favorite rules of thumb and quotes in the comments.