comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <condicma@bogon.pwfl.com>
Subject: Re: performance of Generic and strings
Date: 1999/08/11
Date: 1999-08-11T00:00:00+00:00	[thread overview]
Message-ID: <37B1B634.543D131D@pwfl.com> (raw)
In-Reply-To: 7osak8$gph$1@nnrp1.deja.com

Robert Dewar wrote:

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

My understanding was that there are two ways to implement generics - one
was macro-like expansion and the other was via some sort of "profile"
information which could make the code common, but change the behavior
for each generic instance. (For example, keeping pointers to
subprograms, size information for various data types, etc. and the
generated code operates using the profile info when calling subprograms,
moving data, etc.)

Clearly, a code expansion technique would pose no time penalty -
provided the compiler did not do some different form of code generation
when it went to compile generics vs standard stuff. (I believe we've had
examples of this in earlier Ada compilers.) There is, however, an
obvious space penalty as well as a serious verification issue to this
technique.

Given that Thomas was originally complaining of a speed penalty, I
suppose I was presuming his compiler must be using an implementation
technique that would account for this. I have also been informed by
other experts in the Ada compilation field that there are certain
language issues involved with the macro expansion technique which make
the profile technique more attractive. (I won't name names, not wishing
to draw anyone unwillingly into the fray, but feel free to leap to my
defense here. :-)

As to which is more commonly used? Not being a compiler vendor myself,
I'll defer to those who make it their business to know the market.
However, between the two, I think I'd rather have instantiation done
with some sort of profile information rather than expansion. While
normally, I'd come down on the side of speed, in this instance, I'd
prefer the space savings as long as the time penalty was minimal. It
also greatly reduces verification problems, which is a tremendous
concern around here.

MDC
--
Marin David Condic
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
***To reply, remove "bogon" from the domain name.***

Visit my web page at: http://www.mcondic.com/






  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 ` Michael F. Yoder
1999-08-11  0:00 ` Marin David Condic
1999-08-11  0:00   ` Robert Dewar
1999-08-11  0:00     ` Marin David Condic [this message]
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
replies disabled

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