News for hackers. Stuff that matters.
Re:Which is faster? while(1) {} or while(2) {} by rayiner on Monday July 21, 2014 @10:10AM (#8063697)
Depending on the CPU architecture and optimization level, there could be a host of different reasons. E.g. if you compile it to a comparison against a constant, on x86 you could go from a one byte immediate to a 4 byte immediate (if the test value is greater than 255), which could cause your loop to fall out of the loop buffer depending on what's inside the loop. If that's what the interviewer is trying to get at... this is a poor vehicle for it.

There are no comments on this comment yet.