[comp.lang.ada] Generics and disk overhead

sommar@enea.se (Erland Sommarskog) (03/02/88)

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.