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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!mnetor!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.ada Subject: Generics and disk overhead Message-ID: <2792@enea.se> Date: 2 Mar 88 12:51:46 GMT Reply-To: sommar@enea.UUCP(Erland Sommarskog) Followup-To: comp.lang.ada Organization: ENEA DATA AB, Sweden List-Id: The scene: Four generic packages, a list handler(L), a queue and stack handler(QS), a binary-tree handler(B) and a package for topological sorting(T). Some of the procedures in B are also generic. Add to this a main program (M). Now M instantiates T, which instantiates B and QS and also some of the procedures in B. Finally QS instantiates L. All packages have a limited type parameter. The size of the code was around 1100 lines, including comments, in kbytes around 40. After compilation and linking this expanded to 900 kbytes! I find that quite extreme. My environment is VADS 5.41, 4.3 BSD and VAX. VADS uses the DIANA format, and these files are also the big consumers of disk space, but I have no idea if it is really necessary. To compare I also compiled and linked the program on VMS with DEC-Ada. This costed 430 blocks or 220 kbytes. Somewhat more reasonable. However, DEC does cheat. Recompiling a generic body invalidates the instantiations. On the other hand recompilation with seven reinstantiations took a good time with VADS. I'm not really sure whether DEC's cheating is permitted or not. The paragraph in question would be 10.3(7-9). Anyone who knows? But VADS seems definitely to be doing it wrong. Under some circumstances the library acts as if a generic body was dependent of its instantiation. -- Erland Sommarskog ENEA Data, Stockholm sommar@enea.UUCP "Souvent pour s'amuser les hommes d'equipages and it's like talking to a stranger" -- H&C.