comp.lang.ada
 help / color / mirror / Atom feed
From: ka@socrates.hr.att.com (Kenneth Almquist)
Subject: Re: GNAT function calling overhead
Date: 1995/04/07
Date: 1995-04-07T00:00:00+00:00	[thread overview]
Message-ID: <D6nA9u.Hq7@nntpa.cb.att.com> (raw)
In-Reply-To: 3m0nv1$pv2@nef.ens.fr

(Duncan Sands wants to know why matrix multiplication is slow using:
   type Matrix is array(Positive range <>, Positive range <>) of Float;
   function  "*"(Left : in Matrix; Right : in Matrix) return Matrix;
He observes that he gets about a 20% speedup if he manually inlines the
matrix multiplication and wants to know why the calling overhead is so
high.)

This has little to do with function call overhead per se.  The problem
is that GNAT produces ineffient code for subscripting operations on
Matrix variables when the bounds of the matrix are not known at compile
time.  GNAT does somewhat better when the matrix is not passed as an
argument; hence the performance improvement from inlining.

I hope that GNAT funding will cover a bunch of performance tuning, but
unimplemented features and bug fixing presumably have higher priority
right now.  Of course one of the advantages that GNAT gains from using
the GCC back end is that even if nobody on the GNAT project gets around
to looking at this particular performance problem, somebody from another
project, such as GNU Fortran, might fix it.
				Kenneth Almquist




  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
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 [this message]
1995-04-07  0:00   ` Larry Kilgallen
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   ` Robert Dewar
1995-04-07  0:00 ` Robert Dewar
1995-04-07  0:00 ` Theodore Dennison
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