From: Olly B. <ol...@su...> - 2000-02-26 20:49:39
|
[Cc:-ing reply to list, since it seems pertinent] In message <Pin...@pe...>, Grzegorz Adam H ankiewicz writes: >On Fri, 25 Feb 2000, Olly Betts wrote: >> But a 62% increase in size seems unreasonable. > >What are your compiler switches to build your program? >Are you stripping debug information? Building with -O2 and -g, and I'm linking with "-s" so debug info is stripped. >Have you tried with some of the tips of the Allegro documentation to make >the exe size smaller? I wasn't aware of them - I think they must have been added since I last read the documentation. Turning off all the midi, sound, and joystick drivers knocks the size down quite a lot: Allegro 3.1 (built with gcc 2.7.2): 387,584 Allegro 3.9.31 (with gcc 2.95.2): 628,888 Ditto, without sound/midi/joystick: 478,720 Which is a bit more like it. It would be cleaner if the library structure allowed the linker to decide which drivers are never going to be used by a program automatically, but at least you aren't stuck with pulling them all in. >As for your opinion about the issue of your executable taking too much >memory to be run, that's true if it's loaded in memory. However, that is >not necessary always. DJGPP can swap out unused code to disk. Not always. It depends a lot on the DPMI host in use (some prevent VM working at all, others restrict the size - see the DJGPP FAQ for the gory details). The user also needs enough free disk space to allow swapping out the unused parts of library (AFAIK DJGPP doesn't page code in from the executable like Unix generally does). Making it worse, the larger executable sizes mean they'll have less free disk space anyway. And this reduces the size of the data that the programs can handle before running out of memory. This problem also bloats up the distribution archives, which means more disk space used on my web server, more bandwidth used for downloads (I don't pay by used bandwidth at present, but may soon; it does costs most end users more to be online longer to download larger files). It also means that the distribution will fail to fit on a floppy much sooner. And yes I can compress the files with DJP or whatever, but that's orthogonal to this issue - unbloated executables can also be compressed. And the compressed executables won't compress well in the zip file anyhow. Cheers, Olly |