From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,91cc2b2a631886b8 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Generic Packages Date: 1998/08/11 Message-ID: #1/1 X-Deja-AN: 380029592 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: <35CF1129.4DCB0B15@lmco.com> Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1998-08-11T00:00:00+00:00 List-Id: 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