The Golden Rules of optimization The 80/20 Rule In general, 80% percent of a program's execution time is spent executing 20% of the code 90°%/10°% for performance- hungry programs Spend your time optimizing the important 10/20% of your program Optimize the common case even at the cost of making the uncommon case slower Fa|2011 Advanced Compiler techniques5 Fall 2011 “Advanced Compiler Techniques” The Golden Rules of Optimization The 80/20 Rule ◼ In general, 80% percent of a program’s execution time is spent executing 20% of the code ◼ 90%/10% for performance-hungry programs ◼ Spend your time optimizing the important 10/20% of your program ◼ Optimize the common case even at the cost of making the uncommon case slower