From: "quark(particle)" Newsgroups: comp.os.msdos.djgpp,rec.games.programmer Subject: Re: Any tips on optimizing C code? Date: 13 May 1997 12:24:10 EDT Organization: WebSpan Inc., New Jersey Lines: 49 Message-ID: <5la4ja$11b@news.webspan.net> References: <33775c59 DOT 19219875 AT news DOT cis DOT yale DOT edu> <01bc5f6f$c3000be0$cf1afec3 AT robert> <337865D0 DOT FB8 AT cornell DOT edu> NNTP-Posting-Host: usr5-13.bay.ny.webspan.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I've read the Michael Abrash text.. and.. well.. I still think that integer math is faster... I had few floting point programs which doubled their speed once I converted them to integer math... and I have a Pentium. and a 486. pentium is better with floting point numbers than the 486, but nothing beats clean integer math. I mean... who would use floting numbers in a simple line algorithm... everybody wants the "all integer, no shifting" aproach...... why? wouldn't it be easier just to write the thing with floting point number? quark(particle) quark AT webspan DOT net http://www.webspan.net/~quark C/C++/ASM/Java/JavaScript/HTML/Perl A. Sinan Unur wrote in article <337865D0 DOT FB8 AT cornell DOT edu>... >Robert Blum wrote: >> >> jon wrote >> > 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. >> >> Duh.. That must have been from a very old source of information. On >> the Pentium (I assume you use one), FP is even faster than integer >> performance. > >actually, that has been so since the 486. michael abrash wrote about his >experience in dr dobbs some time ago. anyway, the moreal of the story is >"measure before you optimize". >-- > Sinan > >******************************************************************* > A. Sinan Unur WWWWWW > |--O+O > mailto:sinan DOT unur AT cornell DOT edu C ^ > http://www.people.cornell.edu/pages/asu1/ \ ~/ > >Unsolicited e-mail is _not_ welcome, and will be billed for. >******************************************************************* >