Erik Hofman writes:
> 
> Norman Vine wrote:
> 
> >>>http://www.a1.nl/~ehofman/fgfs/download/usertime.output.gz
> > 
> > 
> > You have to let the process run much longer
> > until things like ssgMakeMipMaps don't show up in the top 100 :-)
> 
> There is a new file after running FlightGear for about 23 minutes.


Hmm....
    [40]     24.060   1.7%   29.3%     61.140   4.3%       2038  __powf (libm.so: 
fpow.c, 145)
    [96]     19.500   1.4%   35.3%     19.500   1.4%        650  __exp (libm.so: 
exp.c, 103)
   [102]     17.460   1.2%   37.8%     17.460   1.2%        582  __log (libm.so: 
log.c, 207)

I don't think these ever showed up before :-(

Maybe this will help show how not to have pow() show up anyway
The others often have work arounds too.

Norman


#include <math.h>
#include <stdio.h>
#include <time.h>

int main(int argc, char **argv)
{
    double color[3];
    double sun_factor = 1;
    int i;
    int n=1000000;
    int start = clock();
    
    for( i=0; i<n; i++ )
    {
        color[0] = pow(sun_factor, 0.25);
        color[1] = pow(sun_factor, 0.50);
        color[2] = pow(sun_factor, 4.0);
    }
    printf("%d %f %f %f\n",clock()-start, color[0],color[1],color[2]);
    
    start = clock();
    for( i=0; i<n; i++ )
    {
        color[1] = sqrt(sun_factor);
        color[0] = sqrt(color[1]);
        color[2] = sun_factor * sun_factor;
        color[2] *= color[2];
    }
    printf("%d %f %f %f\n",clock()-start, color[0],color[1],color[2]);

    start = clock();
    for( i=0; i<n; i++ )
    {
//        if( sun_factor == 1 )
//        {
            color[0] = 1;
            color[1] = 1;
            color[2] = 1;
//        }
//        else if( sun_factor == 0 )
//        {
//            color[0] = 0;
//            color[1] = 0;
//            color[2] = 0;
//        }
    }
    printf("%d %f %f %f\n",clock()-start, color[0],color[1],color[2]);
}


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

Reply via email to