Zalo DS Blog

Wednesday, November 15, 2006

Unexpected profiling results

I am starting to hate this XDDDD

This morning I realized that I haven't done some floats operations and get their times. Everybody in forums when you talk about floats says:"Nooooo, atay away from them. Fixed point, fixed point!!"

I have added to yesterady's program a multiplication and a division with float numbers.
Basically the coded added is like this

float fa = 1000000000.0f;
float fb = 0.0000000001f;
float fc;
counter->Reset();
int t8 = 0;
for(int i = 0; i < NUM_OPS; ++i)
{
fc = fa++ * fb++;
t8 += counter->GetTimeSinceLastCall();
}
printf("FMUL T8: %d %f\n", t8, fc);

counter->Reset();
int t9 = 0;
for(int i = 0; i < NUM_OPS; ++i)
{
fc = fa++ / fb++;
t9 += counter->GetTimeSinceLastCall();
}
printf("FDIV T9: %d %f", t9, fc);

And... the results obtained are
FMUL 11446ms
FDIV 18619ms

Strange isn't it? Personally I was expecting something else... I mean... fixed point is a pain in the neck and there is always problems with them (that annoying overflow is not the only one). For multiplications the time increases until 3 times with fixed point but wiht divs... it takes less time??

With these results... I don't know what to do :P Should I use floats or use fixed point? Should I continue wasting my time on a FP class? I think that I am going to ask in any for... I mean, I am going to investigate a little bit

6 Comments:

  • Yo must use fixed point, forgot the floats. The fixed points are very fast and more easy to use.

    I hope that u understand any part of this comment XDD, my english is very bad :(

    Salu2

    By Anonymous Anonymous, at November 15, 2006 11:59 PM  

  • Yeah, I understand you... my english is not for throwing rockets XDDDDDD

    You still think I should use them? Based on the obtained results...

    Well, wait for tomorrow's post. I've got something new ^_^

    By Blogger Zalo, at November 16, 2006 12:47 AM  

  • Forget about fixed/floating point and USE THE FORCE, Luke !!! xD

    By Anonymous Anonymous, at November 16, 2006 10:36 AM  

  • Listen to Xamar, The Force Will Be With You!!!!

    Use only "int", and so you can throw rockets XDDD

    Salu2

    By Anonymous Anonymous, at November 16, 2006 12:58 PM  

  • Uhmmm the ds dont have a Float unit??? why dont use?? XD

    my english is the worse of 3 jaajaj

    By Anonymous Anonymous, at December 03, 2006 6:31 PM  

  • The DS doesn't support floats by hardware but arm compiler creates code for them.

    The thing is that sometimes the code created for fixed point is slower than the one created for floats

    By Blogger Zalo, at December 04, 2006 12:51 PM  

Post a Comment

<< Home