Date: Mon, 13 Oct 1997 16:19:12 +1100 From: Bill Currie Subject: Re: Simple == Big In-reply-to: <61lbqi$d1b$2@news.ox.ac.uk> To: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot), djgpp AT delorie DOT com Message-id: <199710130316.QAA05324@teleng1.tait.co.nz gatekeeper.tait.co.nz> Organization: Tait Electronics Limited MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Comments: Authenticated sender is Precedence: bulk On 10 Oct 97 at 13:50, George Foot wrote: > Myknees (myknees AT aol DOT com) wrote: > : Now here's the kicker. I also added the -O3 option, and the > resulting : executable was still the same size. Does this mean that > all simple : programs compiled with djgpp will always be > inordinately large? [snip] > The real problem, though, is that your program isn't a sensible test > of the compiler's code generation. It's not particularly useful, it > doesn't benefit at all from running in protected mode, and some of > the program is no doubt simply dead weight. When you write longer > programs, though, they will not increase in size so quickly; most of > your code at present is one-off information that is included in > every executable. If you want a good example of djgpp code generation, check out my kernel (http://www.abwillms.demon.co.uk/prog (Bill Currie's PC Bootable Kernel)) It does a fair bit (serial ports, keyboard, ide, fdc, xmm, screen (text, 80x60) ...) and the code is < 38k. My wip version is 34k code and 43k data (mostly 0's). > Bottom line: If you want to improve the library_code:program_code > ratio of your programs, write more program code and stop worrying > about it :) Agreed. > > Also, you might like to get hold of a copy of DJP, the executable > file compresser for djgpp programs. It's in a zip calls mlp???b.zip > somewhere on the FTP sites (sorry, I can't give an exact reference > ATM; no doubt the FAQ points to it). ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/mlp105b.zip and ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/mlp105s.zip Bill -- Leave others their otherness.