Re: while ();




\\\o///annabee wrote:
> På 30 Jan 2006 13:57:31 -0800, skrev <robertwessel2@xxxxxxxxx>:
>
> >> and it certainly wount matter
> >> at all then, because 3 iterations will be closer to nothing.
> >
> >
> > Obviously the notion that a loop with few iterations might be inside a
> > big loop has escaped you.
>
> ?? :)
>
> > If you have a million iterations around a
> > small loop of two or three iterations the performance of the small loop
> > will most certainly matter, and with that few iterations branch
> > (mis)prediction will be a significant issue.
>
> :) Wrong! Following is code to show you wrong.
>
>(...)pointless code snipped
>
> What you claim is irrelevant from a optimization perspective.


*Sigh*

Try coding the short loop two ways - one where it generates one branch
misprediction, the other two.

.



Relevant Pages

  • Re: Can this loop be made faster ?
    ... |> Optimisation: maximal 16 iterations for loops which contain one branch, ... |> otherwise the branch-prediction-table will reload (8 clocks penalty ... |> every/after 16 iterations on AMD). ... but if a second Jcc is within the loop then there are more ...
    (alt.lang.asm)
  • Re: Can this loop be made faster ?
    ... increments, of course, the MEMORY at eax ... at least within the loop. ... maximal 16 iterations for loops which contain one branch, ... | routine, and the time is the divided by 100000 after all the calls. ...
    (alt.lang.asm)
  • [Pos] Some quest reward problems identified [Pos]
    ... randart.txt every single time a rand-art is created, ... The tailored reward loop should theoretically trigger a pretty sane ... The number of iterations is fame/5. ... Will look for the rand-art issue later... ...
    (rec.games.roguelike.angband)
  • Re: timeit module: am I missing something obvious?
    ... Why am I passing strings around when functions are ... best of 3 trials: 0.792 usec per loop ... quickly choosing number of iterations. ... - The result from the final pass through the convergence loop ...
    (comp.lang.python)
  • Re: while ();
    ... >>> One thing to remember is that most CPUs, in the absence of any other ... >>> at the end of the loop. ... >>> If you take many iterations through the loop, ... > is that it wount matter if many iterations, ...
    (alt.lang.asm)