Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!amdahl!drivax!alexande From: alexande@drivax.DRI (Mark Alexander) Newsgroups: comp.sys.ibm.pc Subject: Re: TC2.0 upgrade thoughts, and a decision... Summary: EXE size not a good indicator of code quality Message-ID: <4205@drivax.DRI> Date: 29 Jan 89 05:23:11 GMT References: <32234@tut.cis.ohio-state.edu> <13872@cup.portal.com> <4547@tekgvs.GVS.TEK.COM> <4197@drivax.DRI> <32925@tut.cis.ohio-state.edu> Reply-To: alexande@drivax.UUCP (Mark Alexander) Distribution: usa Organization: Bob-ist Temple of Monterey Lines: 31 In article <32925@tut.cis.ohio-state.edu> Christopher Schanck writes: >... the bottom line for compilers is the .EXE size... But even this is not always true. Some compilers (MetaWare High C, for example) will generate a 20K executable for "hello world" programs, if you don't use some little tricks at link time, while Turbo and Datalight produce much smaller EXE files. Yet High C produces smaller code, on the average, than either of the latter. The reason for this is that the EXE file includes all sorts of code from the runtime library. The size of this code is highly dependent upon how clever and industrious the writers of the library were. MetaWare is great on code generation, but their runtime library bites the wax tadpole. EXE files also may differ in size depending on whether the particular compiler used supports the idea of a BSS or UDATA segment to store uninitialized variables. Both Turbo and Datalight zero the BSS section at runtime, so it doesn't take up any room in the EXE file. But MetaWare doesn't. So if you declare an 30K byte static array in your program, your EXE file will be 30K larger with MetaWare than with Turbo. That 30K array appears in the EXE file as a bunch of zeroes. Microsoft gets around this problem with their EXEPACK utility. Yet another item that increases EXE file size is debugging information used by CodeView (I don't know about Turbo Debugger). The bottom line when comparing code size is the size of the code segment in an individual OBJ file. -- Mark Alexander (amdahl!drivax!alexande)