comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: performance of Generic and strings
Date: 1999/08/11
Date: 1999-08-11T00:00:00+00:00	[thread overview]
Message-ID: <7osak8$gph$1@nnrp1.deja.com> (raw)
In-Reply-To: 37B18AB6.BBAEF44A@pwfl.com

In article <37B18AB6.BBAEF44A@pwfl.com>,
  e108678@pwflcom wrote:
> Generally, an implementation would require one more layer of
indirection in
> references to things which are generic sort of like the extra
layer of
> indirection implied by object oriented stuff. (A tag lookup
prior to jumping
> to a subroutine, for example.) Granted, this is overhead


There is no such overhead in typical implementations of
generics, so it is not clear what you are talking about.

If you are using an implementation that shares generic bodies,
then indeed there are time penalties, but most (nearly all?)
Ada 95 compilers handle generics with full "macro type"
inline expansion, so there are no penalties at all. This is
most certainly true of GNAT.

Of course if you PROGRAM a level of indirection, e.g. passing
a procedure pointer to the generic subprogram, you get extra
overhead, but you would get exactly the same overhead passing
the same procedure pointer to a non-generic version of the
subprogram.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




  reply	other threads:[~1999-08-11  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-11  0:00 performance of Generic and strings Thomas Rutström
1999-08-11  0:00 ` Marin David Condic
1999-08-11  0:00   ` Robert Dewar [this message]
1999-08-11  0:00     ` Marin David Condic
1999-08-13  0:00       ` Robert Dewar
1999-08-13  0:00         ` Martin Dowie
1999-08-14  0:00           ` Robert Dewar
1999-08-16  0:00             ` Martin Dowie
1999-08-13  0:00         ` Richard D Riehle
1999-08-13  0:00         ` Marin David Condic
1999-08-11  0:00 ` Robert Dewar
1999-08-11  0:00 ` Michael F. Yoder
replies disabled

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