Mail Archives: djgpp/1995/09/28/10:09:39
Malcolm Taylor (empty AT sans DOT vuw DOT ac DOT nz) wrote:
> kari0022 AT gold DOT tc DOT umn DOT edu wrote:
> : I recently switched from Borland TurboC to djgpp. The EXE's that I get after compiling
> : run much, much faster. However, in TurboC you could optimize your EXE for either
> : speed, or size. How can I completely 100% optimize my EXE's in djgpp for speed?
> : How about the other way around, for size? In both cases, I want to completely ignore
> : the other one, like I want a really really fast executable, and I really don't care
> : at all how large it is.
> gcc -O3 ...
> will optimize for speed, using inline functions, and inlining small
> functions at the compilers discretion...
[ Stuff Deleted ]
From memory, I think -O optimisation tries to avoid code bloat, so this
should produce smaller executables. In all cases, NOT using the -g flag and
using 'strip' on the binary before converting it to an executable using
coff2exe will give you a considerable reduction in code size.
> Read the documentation for gcc (info gcc) about the -O command.
Yep, the docs on gcc command-line arguments are very comprehensive.
Mark.
--
..--------------------------{ From: Mark Lewis }--------------------------.
| Computing Services | http://www.city.ac.uk/~sl323/home.html |
| City University | PGP public key available by WWW, or by |
| London, England | fingering sl323 AT finger DOT city DOT ac DOT uk |
`--------{ M DOT Lewis AT city DOT ac DOT uk (MIME) | nostra AT city DOT ac DOT uk (MIME) }---------'
- Raw text -