comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Generic Packages
Date: 1998/08/11
Date: 1998-08-11T00:00:00+00:00	[thread overview]
Message-ID: <ExIy0n.1Ey.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 35CF1129.4DCB0B15@lmco.com

Tory Patnoe (tory.l.patnoe@lmco.com) wrote:

: Here is a quick question which I was unable to find the answer to in 
: the Ada95 Reference Manual.

: I have a program which takes a long time to elaborate.  I am suspecting 
: it has something to do with the generic integer_io.  The
: current program (not my design!) looks something like this...

: package process1 is
:     yada-yada-yada;
:     package int_io is new integer_io; use int_io;
: end process1;

: package process2 is
:     more yada-yada-yada;
:     package int_io is new integer_io; use int_io;
: end process2;

: Does the compiler make TWO separate instantiations of int_io in this case?   

Probably.

: ... It would, therefore, make my code larger 

Somewhat, though the Integer_IO put routines should not be
huge.  I would presume most of the logic is in out-of-line,
non-generic routines used by Integer'Image & 'Value as well.

: ... and take more time at elaboration?  

This seems very unlikely.  I can't imagine what the
elaboration of Integer_IO is doing other than setting a few
elaboration bits true.  Of course, your compiler might be
painstakingly building up some sort of parsing table at elaboration
time, but if so, probably time to start evaluating other vendors.

: I suspect this is the case and consequently it would be better to 
: do something like this.

: package int_io is new integer_io; use int_io;

: with int_io; use int_io;
: package process1 is
:     yada-yada-yada;
: end process1;

: with int_io; use int_io;
: package process2 is
:     more yada-yada-yada;
: end process2;

This is certainly preferable in general.  But I would be
very surprised if this explains any significant space or time
spent in elaboration.  Have you tried using any sort of
CPU-time profiling?

: Thanks

: Tory

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics/AverStar, Inc.  Burlington, MA  USA




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

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-10  0:00 Generic Packages Tory Patnoe
1998-08-11  0:00 ` Tucker Taft [this message]
1998-08-11  0:00 ` Robert I. Eachus
1998-08-12  0:00 ` Dale Stanbrough
1998-08-17  0:00 ` Dr. Hubert B. Keller
1998-08-27  0:00   ` Simon Wright
  -- strict thread matches above, loose matches on Subject: below --
2002-07-09 13:03 generic packages Sami Evangelista
2002-07-09 13:28 ` Fabien Garcia
2002-07-09 13:41   ` Sami Evangelista
2002-07-10  2:00 ` SteveD
2002-07-11 13:41   ` Sami Evangelista
2002-07-11 20:56     ` Adam Beneschan
2001-04-19 21:27 Generic Packages Eyal Ben-gal
2001-04-19 20:26 ` Ehud Lamm
2001-04-19 22:09 ` Robert A Duff
2001-04-20  6:50   ` Ehud Lamm
2000-02-16  0:00 Generic packages David Olsson
2000-02-16  0:00 ` R. Tim Coslet
     [not found] <5e03nm$esq@netty.york.ac.uk>
1997-02-15  0:00 ` Generic Packages Jon S Anthony
1997-02-20  0:00 ` phtruong
1997-02-21  0:00   ` Robert Dewar
1997-02-25  0:00     ` Quorlia
1997-02-27  0:00       ` Robert Dewar
     [not found] <4inq3c$lr9@NNTP.MsState.Edu>
1996-03-22  0:00 ` John Herro
1996-03-22  0:00   ` Samuel Tardieu
replies disabled

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