Denis Bakhvalov

HW and SW rules of thumb.

Categories: optimizations

01 Apr 2020

Subscribe to my newsletter, 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. 1
  • Branches occur every 6th instruction. 1
  • 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). 1
  • 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. 1

Other interesting rules of thumbs and quotes:

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

  1. Don’t remember the source.  2 3 4

comments powered by Disqus

Subscribe to get more updates from me:

If you like this blog, support me on Patreon or by PayPal donation.

All content on Easyperf blog is licensed under a Creative Commons Attribution 4.0 International License