According to Wikipedia, the 90 / 10 rule of program optimization states that “90% of a program execution time is spent in executing 10% of the code” (see the second paragraph here).
I really don't understand this. What exactly does this mean? How can 90% of the execution time be spent only executing 10% of the code? What about the other 90% of the code then? How can they be executed in just 10% of the time?
a++; for(i=0;i<100;i++){b++;} for(i=0;i<100;i++){print(xyz);}
. Sure the first for-loop spends a lot more than the first statement, but the second for-loop spends ~1000x more time than the first for-loop, but not executing. It spends it waiting for print. So there's a difference between time spent on execution, and time the code is responsible for.