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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,37680a99b5e22b2b X-Google-Attributes: gid103376,public From: "Pat Rogers" Subject: Re: Shared Generic Instance Code Date: 1997/04/01 Message-ID: <01bc3eef$21c81d80$1e096dce@my-pc.neosoft.com>#1/1 X-Deja-AN: 229969283 References: <5hrkhkINN9ip@snoopy.cis.ohio-state.edu> Organization: Software Arts and Sciences Newsgroups: comp.lang.ada Date: 1997-04-01T00:00:00+00:00 List-Id: david scott gibson wrote in article <5hrkhkINN9ip@snoopy.cis.ohio-state.edu>... > Hi. Could someone summarize the advantages and disadvantages of > having an Ada compiler that when compiling generic units generates > code that may be shared by multiple instances? On the negative side, > I suspect that it increases compiler complexity and could result in > slower executables. On the positive side, it could reduce the size of > executables and perhaps reduce the amount of recompilation in system > generation. Are there other issues such as interaction with other > Ada language features or the presumed utility of code sharing, that > make one approach more attractive than the other? The nature of the generic formal parameters can impose a performance penalty when code sharing is used. Anything that requires the implementation to distinguish between different instances at run-time will cost you. Not all parameters will do so; it isn't always the case that code sharing imposes a penalty, but for example, passing formal subprograms parameters may do it, as well as formal objects of mode "in out", etc....... There's always a trade-off. For real-time applications, this is yet another of those cases that require you to know what you are doing, and is often applicable when comparing languages: the ever-popular "How come when I recode this well-understood piece of code into ADA it is so slow?" comes time mind. (Yes, I put the Ada in upper case on purpose there:)