www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/09/28/10:09:39

Xref: news-dnh.mv.net comp.os.msdos.djgpp:2251
Path: news-dnh.mv.net!mv!news.sprintlink.net!dispatch.news.demon.net!demon!sunsite.doc.ic.ac.uk!cs.city.ac.uk!sl323
From: sl323 AT city DOT ac DOT uk (Mark Lewis)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: OPTIMIZING EXE SPEED
Date: 28 Sep 1995 11:00:40 GMT
Organization: School of Informatics, City University, London
Lines: 31
References: <DEyssD DOT Inv AT news DOT cis DOT umn DOT edu> <43ijgp$jl AT st-james DOT comp DOT vuw DOT ac DOT nz>
Reply-To: M DOT Lewis AT city DOT ac DOT uk
Nntp-Posting-Host: exeter.city.ac.uk
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019