www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/02/11:58:43

Date: Sun, 2 Feb 1997 20:39:19 +0000 ( )
From: Gurunandan R Bhat <grbhat AT unigoa DOT ernet DOT in>
To: "John M. Aldrich" <fighteer AT cs DOT com>
Cc: djgpp AT delorie DOT com
Subject: Re: Theoretical question of loops
In-Reply-To: <32F48302.2186@cs.com>
Message-Id: <Pine.LNX.3.91.970202203655.765B-100000@aditya.unigoa.ernet.in>
Mime-Version: 1.0


On Sun, 2 Feb 1997, John M. Aldrich wrote:

> Pyro Technic wrote:
> > 
> > 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.
> 
> If the code inside the loops is identical (i.e., you don't need to do
> something wierd to the code if 'i' and 'j' need to be reversed, then
> they should run at exactly the same speed.  What matters isn't the
> number of loops, but what's inside them.

i think that if what you have inside is a reference to a matrix, for 
example a reference to a[i][j], then for very large matrices (but only 
for very large mind you) it does make a difference whether you access 
them columnwise or row wise.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019