delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/05/19:11:47

Message-ID: <32D05C99.331@gbrmpa.gov.au>
Date: Mon, 06 Jan 1997 09:59:53 +0800
From: Leath Muller <leathm AT gbrmpa DOT gov DOT au>
Reply-To: leathm AT gbrmpa DOT gov DOT au
Organization: Great Barrier Reef Marine Park Authority
MIME-Version: 1.0
To: "Tony O'Bryan" <aho450s AT nic DOT smsu DOT edu>
CC: djgpp AT delorie DOT com
Subject: Re: Fixed Point (Optimization)
References: <32cd6b2c DOT 4726585 AT nntp DOT southeast DOT net> <01b9bb84$bc3275a0$e2c5b7c7 AT platko DOT ix DOT netcom DOT com> <32cedb2d DOT 17212822 AT ursa DOT smsu DOT edu>

> >Fixed Point math is still very essential for dramatic speed increasement
> >even with today's FPU's.  I never bench marked Fixed Point compared to
> >floating point, so I don't know how much faster it will be; it depends on
> >how often you use it.  A lookup table will most likely increase your speed.
 
> I did a quick check on floating point vs. integers not too long ago.
> I wrote a small loop that only added an integer to an integer counter,
> then rewrote it using floating point variables.  On my Pentium 120,
> integers were THOUSANDS of times faster.  I don't remember the exact
> numbers, but 50,000 loops required a few seconds with the floating
> point.  The integers were so fast that the timer (calculated to
> several digits [7 or 8, I think]) couldn't register the elapsed time.

Whoa! Thousands? Would you mind posting the code? :)  If your using
a pentium, you should use Mark Habersack's header file for timing stuff
on the pentium - it times to a cycle. But to take a few seconds to do
50,000 fp instructions reallys is a _long_ time. (2 seconds is about
5,000 cycles per fp op, or to put in perspective, about 128 divides!)

Leathal.

- Raw text -


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