comp.lang.ada
 help / color / mirror / Atom feed
From: griest-tom@cs.yale.edu (Tom Griest)
Subject: Re: GNAT function calling overhead
Date: 1995/04/07
Date: 1995-04-07T00:00:00+00:00	[thread overview]
Message-ID: <3m40vpINN3p8@RA.DEPT.CS.YALE.EDU> (raw)
In-Reply-To: 3m0psq$fl2@stout.entertain.com

In article <3m0nv1$pv2@nef.ens.fr>, Duncan Sands <sands@clipper.ens.fr> wrote:
[snipped stuff about 10_000 matrix-multplies in an application]
>>In summary: 55 seconds with function calling overhead.
>>            44 seconds without function calling overhead.
>>
>>Now, a 15 by 15 matrix means 225 entries.  225 entries at,
>>say, 8 bytes an entry makes a bit less than 2k.  So, depending on
>>whether GNAT takes function parameters by reference or by copy,
>>this makes anything between 2k and, say, 10k bytes to be copied
>>on each function call.
>>
>>Does this explain the time difference?  It shouldn't!  The amount
>>of time spent copying memory should be completely overwhelmed by
>>the amount of time taken to do the floating point operations!

First, I doubt very much that the matrix is passed by copy.  
Basically, any composite object larger than 8-bytes will be passed 
by reference.

Second, what are your assumptions about the time to perform a
floating point multiply on a 486DX?   The 486 ref manual indicates
that fpadds are typically 10 clocks and an fpmult is around 16 clocks.

Since the formal parameters for your function are unconstrated types,
there is probably a dynmaic allocation/initialization/deallocation 
of the dope vectors for each of the parameters.  This might account
for some of the overhead.

To really give you an answer, you should either get an assembly
listing (-S flag) or provide us the source of both versions.  It is
very hard to give a detailed answer (as opposed to the sort
Colin likes to supply :-)) without this information.

-Tom




  parent reply	other threads:[~1995-04-07  0:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-04-06  0:00 GNAT function calling overhead Duncan Sands
1995-04-06  0:00 ` Norman H. Cohen
1995-04-06  0:00 ` Colin James III
1995-04-06  0:00   ` Robb Nebbe
1995-04-07  0:00     ` Duncan Sands
1995-04-07  0:00     ` Robert Dewar
1995-04-06  0:00   ` Samuel Tardieu
1995-04-07  0:00   ` Tom Griest [this message]
1995-04-07  0:00     ` Robert Dewar
1995-04-07  0:00   ` Philip Brashear
1995-04-07  0:00   ` Robert Dewar
1995-04-07  0:00 ` Kenneth Almquist
1995-04-07  0:00   ` Larry Kilgallen
1995-04-07  0:00     ` Robert Dewar
1995-04-07  0:00   ` Robert Dewar
1995-04-07  0:00   ` Colin James III
1995-04-07  0:00     ` Robert Dewar
1995-04-07  0:00 ` Theodore Dennison
1995-04-07  0:00   ` Robert Dewar
1995-04-07  0:00 ` Robert Dewar
replies disabled

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