Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Function call oddity
@ 1998-07-12 18:56 Dave Gilbert
  1998-07-13  1:06 ` Quant-X Alpha Linux Support
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Gilbert @ 1998-07-12 18:56 UTC (permalink / raw)
  To: axp-list


While trying to really optimise a piece of my code I noticed the following
oddity; build a loop which calls a function many times, make sure the
compiler can't inline the function by placing it after the point of
calling.
If the function has no parameters and no results then this runs
faster than all other cases (expected).

However if the routine has one parameter and a result
then it runs faster than a similar routine without a parameter!!

This is really unexpected to me; by the look of the code it must be
to do with allocation of space on the stack at a guess - wierd!!

       parameter    no param
 
result   6            6.79
 
no res   5.28         4.53

Dave

 --------------------------------------------------------------------
/ Dr. David Alan Gilbert      | Running Linux on Alpha & ARM         \ 
\   gro.gilbert @ treblig.org | ------- Happy in hex -------         /
 \____________________________|___ http://www.treblig.demon.co.uk __/


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-07-13  5:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-07-12 18:56 Function call oddity Dave Gilbert
1998-07-13  1:06 ` Quant-X Alpha Linux Support
1998-07-13  4:43   ` Richard Henderson
1998-07-13  5:32     ` Quant-X Alpha Linux Support

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox