home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / modula3 / 1168 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.8 KB  |  43 lines

  1. Newsgroups: comp.lang.modula3
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!src.dec.com!src.dec.com!mjordan
  3. From: mjordan@src.dec.com (Mick Jordan)
  4. Subject: Re: Why are M3 executables so big?
  5. Message-ID: <1993Jan27.030707.9532@src.dec.com>
  6. Sender: news@src.dec.com (News)
  7. Organization: DEC Systems Research Center
  8. References:  <C1Hp3L.3z7@babbage.ece.uc.edu>
  9. Distribution: usa
  10. Date: Wed, 27 Jan 93 03:07:07 GMT
  11. Lines: 30
  12.  
  13. In article <C1Hp3L.3z7@babbage.ece.uc.edu>, dsims@don.ece.uc.edu (David Sims) writes:
  14. |> Why does the following hello-world program create a 400K stripped
  15. |> executable on my Sparc box?  The .mo file is a mere 399 bytes, but the
  16. |> executable balloons to 400K.  Are the Wr, Stdio, and other run-time
  17. |> libraries really that large?
  18. |> 
  19.  
  20. This is an old chestnut that many new users find astonishing, but we ought to
  21. put it in a little perspective. First, all programs include a relatively
  22. sophisticated storage manager and garbage collector, a lightweight process
  23. package (Thread), and a run-time type system. These artefacts, that in other
  24. languages would count as user libraries, cost quite a bit in code and data
  25. size. There is also some overhead that arises from generating C code instead
  26. of native machine code.
  27.  
  28. In addition, there is substantially more functionality in the libraries,
  29. than hello-world actually needs. We have not tried very hard to structure
  30. the library into small components. I have a prototype tool that optimises
  31. whole M3 programs and, when applied to hello-world, generates an
  32. executable that is 220K in size, as opposed to 417K, on a DECstation 5000.
  33. If this is then optimised with the C compiler, it reduces to 177K.
  34.  
  35. Of course, since you are running on a Sparc, you can use shared libraries
  36. to mitigate the size of executables. 
  37.  
  38. Mick Jordan
  39.  
  40.  
  41.  
  42.  
  43.