comp.lang.ada
 help / color / mirror / Atom feed
From: pontius@btv.ibm.com (Dale Pontius)
Subject: Re: A note on GNAT 3.05 performance
Date: 1996/06/24
Date: 1996-06-24T00:00:00+00:00	[thread overview]
Message-ID: <4qm21c$qig@mdnews.btv.ibm.com> (raw)
In-Reply-To: dewar.835245019@schonberg


In article <dewar.835245019@schonberg>,
        dewar@cs.nyu.edu (Robert Dewar) writes:
>We have discovered a very significant performance issue in GNAT 3.05. It is
>not exactly a bug, but it is certainly a very undesirable inefficiency.
>
>Up to now, we have always arranged that the default calling sequence for
>Ada should be the same as C.
>
>We discovered that there was one respect in which we did not follow this
>rule in GNAT 3.04, namely we did not pass records in a manner consistent
>with C. In C if you pass a record, a copy is always made, so that the
>caller can mess with the record without changing the value in the caller.
>
>So, we "fixed" this "bug".
>
>The trouble is that the result is that all records get copied on calls
>to all Ada subprograms. This has pretty significant efficiency consequences.
>For example, all unbounded and bounded strings are records.
>
When I first began looking at Ada, I wondered if if was 'pass by value'
or 'pass by reference'. The answer was, apparently, 'neither and both'.
It seemed to me that Ada was attempting to 'idealize' a concept by
using copy-in/copy-out that it shouldn't be.

Now maintaining copy-in and copy-out will apparently have a performance
penalty, yet changing that aspect to pass-by-reference will not be
consistant with regular 'in' parameter passing.

Are Ada pragmas frozen in concrete the way the rest of the language
is? Is it feasible to make 'pass by copy' and 'pass by reference'
for record parameters adjustable on a pragma basis? Is it desirable?

Thanks,
Dale Pontius
(NOT speaking for IBM)





  parent reply	other threads:[~1996-06-24  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-20  0:00 A note on GNAT 3.05 performance Robert Dewar
1996-06-21  0:00 ` Michael F Brenner
1996-06-22  0:00   ` Jerry van Dijk
1996-06-24  0:00     ` Robert Dewar
1996-06-28  0:00       ` progers
1996-06-28  0:00       ` Robert A Duff
1996-06-22  0:00   ` Robert Dewar
1996-06-24  0:00 ` Dale Pontius [this message]
1996-06-24  0:00   ` Norman H. Cohen
1996-06-24  0:00     ` Robert Dewar
1996-06-24  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