Boost logo

Boost :

Subject: Re: [boost] Fixed point integer proposal
From: Soren Holstebroe (holstebroe_at_[hidden])
Date: 2009-06-25 19:34:59

2009/6/25 Christian Schladetsch <christian.schladetsch_at_[hidden]>:
> Hello,
> In fact, fixed point is not faster on many architectures than floating
> point. One assumes that it is mainly PSP, DS and Gamecube guys that want
> fixed-point just for speed these days (I'm looking at you, Kenny ;).

On my quad core desktop there is a difference between ints and floats.

I just wrote a quick test with the following loop for some random
initialization values:

        for (int i = 0; i < iterations; ++i)
                sum += a * b;
                a += b;

I used MSVC++ to compile.

I set iterations to a billion. When I used ints I got around 800
ticks. When I used floats I got around 3700 ticks.

That is almost a factor five. For my purposes, that's an optimization
I am willing to sacrifice a lot for.


Boost list run by bdawes at, gregod at, cpdaniel at, john at