On 7/30/07, Dinesh Joshi dinesh.a.joshi@gmail.com wrote:
Umm...the question you asked is very implementation specific. It not only depends on how the compiler optimizes the code but also on the executable code it produces and how exactly the processor executes it.
I'm not considering compiler optimization at all -- let us go with the assumption that we have disabled compiler optimization.
The above example could be implemented as a series of if() else if()... but it isn't and I'm trying to find a reason why. Is there a case where the while(true) approach actually performs better or equal?