Well I was going to reply to this with an amusing anecdote,
then I found that the relevant chapter of Code Complete is
online. Here is a
section from this classic on benchmarking.
in reply to The Best Infinite Loop
The anecdote was that your infinite loop reminded me of the
story of a team that was trying to speed up an operating
system. Well they profiled and found that it spent most of
its time in one loop. So they optimized the heck out of
that loop - only to find no reduction in the time spent in
Turns out that they had optimized the idle loop!
On an ironic note, I have heard elsewhere that even though
they did not speed up the OS, it turned out that they
had made it noticably more responsive to users and
smoother at multi-tasking. So it turned out to be a good
thing to do after all!