Mail Archives: djgpp/1997/02/02/15:35:00
On Sat, 01 Feb 1997 23:35:11 -0800 Pyro Technic <invid AT dmv DOT com> writes:
>I've got a weird question, wich would be faster and how would I
>measuree it. Would doing 2 things 3 times be faster or slower than
>doing
>3 things 2 times.
Depends on how large the code is. If the code fits in the cache, I would
guess that 3 things 2 times would be faster - if it doesn't, then 2
things 3 times. (I'm guessing here, though :)
...Chambers
>
>
>// loop set 1
>//is this faster
>for(i=0; i<3; ++i)
> {
> for(j=0; j<2; ++j)
> {
> //stuff here
> }
> }
>
>// loop set 2
>//or is this
>for(i=0; i<2; ++i)
> {
> for(j=0; j<3; ++j)
> {
> //stuff here
> }
> }
>
>weird stuff. Thanks a lot.
>
> Pyro
>
- Raw text -