Re: Efficient way to pass different shaped arrays?
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Wed, 28 Jun 2006 16:10:53 -0700
Peter <sherwood@xxxxxxxxxxxxxx> wrote:
Efficiency is paramount here, because B is called millions of times. So
I am reluctant to use any method which adds execution time. I guess
that for an assumed-shape array, the address computations are more
time-consuming, since the dimensions are not compile-time constants,
but run-time variables.
While that might be so, it sounds a lot like a guess. (The explicit use
of the word "guess" makes it easy for me to guess that. :-)). If
efficiency is really paramount, I advise testing instead of guessing.
History is full of people making guesses about how to improve
performance and turning out to be very, very wrong. I've done it myself.
(In the distant past, I used to have explicit tests for zero values in
order to "save time" by branching around needless multiplications; I was
thinking of multiplications as the main measure of computational cost.
Of course, the test and branch killed my performance, effectively
costing far more than the multiplication would have).
I'm not saying that your guess is wrong. I'm just suggesting that you
get real data if it really matters. Many people here (myself included at
times) are prone to generalizations about performance issues, but that's
no substitute for testing. Best to do both. Make the guesses about what
ought to work well; but then test it.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- References:
- Efficient way to pass different shaped arrays?
- From: Peter
- Re: Efficient way to pass different shaped arrays?
- From: Michael Metcalf
- Re: Efficient way to pass different shaped arrays?
- From: Peter
- Efficient way to pass different shaped arrays?
- Prev by Date: Re: Efficient way to pass different shaped arrays?
- Next by Date: Re: Efficient way to pass different shaped arrays?
- Previous by thread: Re: Efficient way to pass different shaped arrays?
- Next by thread: Re: Efficient way to pass different shaped arrays?
- Index(es):