From: Bill Currie 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: NNTP-Posting-Host: node106.tssc.co.nz Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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