From: Jeremy Bopp Date: 2010-10-31T23:49:49+09:00 Subject: Re: Is this an effective loop On 10/31/2010 05:15 AM, Robert Klemme wrote: > On 30.10.2010 00:47, Jeremy Bopp wrote: >> On 10/29/2010 5:36 PM, Ammar Ali wrote: >>> I see. I excluded the i += 1 from the for and times loops because >>> that is >>> done automatically. Adding them seemed to add work that was not >>> necessary >>> for those constructs, and IMHO, make the benchmark inaccurate. >> >> That's definitely a debatable point in this benchmark because we are >> essentially doubling the number of add operations for the loops that >> perform it implicitly. However, we also want to see how the choice of >> looping mechanism affects the operations performed within the loop, so >> making the looped operations completely identical has its merits. > > I'm sorry but this is nonsense: different loop constructs are > benchmarked precisely to determine which iteration is quicker. > Incrementing the loop variable is one of the things that make up the > difference between looping constructs so there is no point in doing this > "manually" just to make loop bodies look identical. Yeah, I suppose you're right now that I think about it again. Thanks for the smack with the clue-by-four. ;-) -Jeremy