Erik Hofman writes:
> 
> Yes, I mean 250% increase. But I doubt many others would see such an 
> increase because my framerates were already close to freezing point...

Ummm.....

<533> math
$ c++ -O3 -o test test.cxx fastmath.cxx

<534> math
$ ./test
log        3044
fast_log   3164
exp        7150
fast_exp   9764

==== cut -- test.cxx ====

#include "fastmath.hxx"
#include <stdio.h>
#include <time.h>

int main(int argc, char **argv)
{
    float a = 1.2;
    float b;
    int i;
    int n=10000000;
    int start = clock();

    for( i=0; i<n; i++ )
    {
        b = log(a);
        a += 0.00001;
    }
    printf("log        %d\n",clock()-start);

    for( i=0; i<n; i++ )
    {
        b = fast_log(a);
        a += 0.00001;
    }
    printf("fast_log   %d\n",clock()-start);

    for( i=0; i<n; i++ )
    {
        b = exp(a);
        a += 0.00001;
    }
    printf("exp        %d\n",clock()-start);

    for( i=0; i<n; i++ )
    {
        b = fast_exp(a);
        a += 0.00001;
    }
    printf("fast_exp   %d\n",clock()-start);
    
}



_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to