delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/26/22:02:07

From: Bill Currie <bcurrie AT tssc DOT co DOT nz>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Is PGCC really worth it?
Date: Fri, 27 Feb 1998 14:51:45 +1300
Organization: Telecommunication Systems Support Centre
Lines: 23
Message-ID: <34F61C31.5DFE@tssc.co.nz>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980225172621 DOT 2648O-100000 AT is>
NNTP-Posting-Host: node106.tssc.co.nz
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Eli Zaretskii wrote:
> In any case, I would suggest profiling your program first, to see
> where does it spend most of the time.  See chapter 13 of the FAQ for
> more details.

I second this!  When I profiled my editor to find out why it took so
long to update the screen, I found that the slug was nowhere near where
I thought it was.  Turned out I was calling a function ~80 times per
line, and this function had a multiply instruction in it.  Even though I
wrote every line of code involved (some of it asm!!), I would never have
found this slug without using a compiler.  BTW, my editor went from a
craw at 34 lines to snappy at 60 lines, just by changing the update
algorithm.

As Michael Abrash says, profile, profile, profile! check your algorithm
and profile again.  Changing the algorithm can give you more gains than
tweaking assembly.  I'm not belittling pgcc or assembly, just get your
algorithm right first, then worry about code generation (I learned this
the hard way).

Bill
-- 
Leave others their otherness

- Raw text -


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