From: quacci AT vera DOT com (jon) Newsgroups: comp.os.msdos.djgpp,rec.games.programmer Subject: Any tips on optimizing C code? Date: Mon, 12 May 1997 18:15:08 GMT Organization: Yale University Lines: 13 Message-ID: <33775c59.19219875@news.cis.yale.edu> NNTP-Posting-Host: slip-ppp-node-05.cs.yale.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I'm interested in understanding what can be done to speed up straight C code. In the specific thing I am writing, I've already done the obvious things, like switched most calcs from FP to integer, using bit shifting wherever possible for multiplying and dividing, etc. But is there a complied source of information on just what-is-faster-than-what? Like, does running a "for" loop by decrementing rather than incrementing actually save a cycle? or does a "case" command actually beat a series of "if"s? Do global variable speed things up? I figure there must be something out there that has the low-down on just this sort of nitty-gritty info. DJGPP is my compiler of choice, if that makes a difference.