Re: MODULEand USE versus Argument Passing
Herman D. Knoble wrote:
Given a Subprogram that gets called millions of times,
we know that there is (CPU) overhead for subprogram linkage.
My question is, independent of compilers, which is more efficient
in practice:
passing a list of (say 3 to 10) arguments to a subprogram's
corresponding parameters,
OR using a Module and companion USE statement,
OR use named COMMON?
Skip Knoble
Seriously, I think the answer is none of the above, it's
"whatever makes the most sense to you". If the subroutine
does anything significant, then the call overhead is
likely to be small either way, and if the subroutine is
small (for some definition of small ;) ), turn on inlining
and let the compiler figure it out.
I once spent a fascinating week debugging someone else's
code (I'd never make this kind of mistake ;) ) where
there was a
COMMON blah blah I,J, blah blah
in the main program and a
COMMON blah blah J,I, blah blah
in the subroutine.
Again, seriously, write it in a way that is easiest to
understand and don't sweat the small stuff.
*** Hendrickson
.