www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/16/03:21:11

Date: Sun, 16 Jun 1996 09:47:37 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Shawn Hargreaves <slh100 AT york DOT ac DOT uk>
Cc: djgpp AT delorie DOT com
Subject: Re: Speed optimization: memcpy() or for loop ??
In-Reply-To: <Pine.SGI.3.91.960613230307.20362B-100000@tower.york.ac.uk>
Message-Id: <Pine.SUN.3.91.960616094520.12400P-100000@is>
Mime-Version: 1.0

On Thu, 13 Jun 1996, Shawn Hargreaves wrote:

> I think you people are seriously underestimating the power of gcc's 
> optimiser. It is _good_ :-) Tricks like this may occasionally gain a slight 
> speed increase, but in most cases gcc will do them for you if you just 
> write your loop in the simple and obvious way. Making something this 
> complicated can even be counterproductive: it obscures what you are 
> trying to do, so the optimiser is less likely to figure out ways to make it 
> faster.

The usual way to optimise the program is to make it work right, then to 
profile it, and only *then* to optimise the fragments that appear as 
``hot spots'' in the profile.

> You wouldn't be an ex-Borland user, by any chance? I notice people who 
> have used Borland usually have a hard time trusting the compiler to produce 
> good code without lots of help :-)

Even this seems to be not true since BC 3.x.

- Raw text -


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