Speed comparism and Compiler question

28 Nov 2010

Some help needed please.

1. Anyone ever done a speed comparism between mbed, Arduino mega and the Arduino Duemilanove? I have written some floating point maths for these three boards and am wondering why the mbed is so slow. Is this normal or am i impatient.

2. How can i import a complete Program from the local disk without having to import each file separately. I already have about 12 files in my project and importing them single is rather boring.

Thanks for your help.

28 Nov 2010

To answer at least #2: You can import a ZIP file from disk.

28 Nov 2010

user voy ager wrote:

Some help needed please.

1. Anyone ever done a speed comparism between mbed, Arduino mega and the Arduino Duemilanove? I have written some floating point maths for these three boards and am wondering why the mbed is so slow. Is this normal or am i impatient.

mbed should easily beat any 8-bit AVR. Show us your code and measuring methods.

05 Dec 2010

None of of the micros have an FP unit, so it is very dependent on the FP library implementation.

If you were attempting to use the AVR FP Library you would probably see performance issues.

But as Igor states, the LPC1768 should easily beat an 8bit AVR, not only is the clock speed higher, it supports hardware multiply and divide, not to mention 32bit operations.

06 Dec 2010

First of all thanks for the replies. I am sorry for the inconvenience caused. The failure was on my side. My first mbed seems to have some problems with its speed. The second one i bought is working perfect and really is much faster than the 8bit AVRs. I will try to analyse the first board to find out what is causing the problem.

06 Dec 2010

I came up with a little program a while ago to compare floating point vs. integer operation execution time. I never got around to publish it, so here it is now.. Be sure to use the correct CCLK to get meaningful results..

benchmark

07 Dec 2010 . Edited: 07 Dec 2010

 

Beware - results can be invalid for that code, in that a good compiler's optimizer will toss out the for loops becuase the result of the calculation is nowhere used - even if declared volatile.

And of course, there are varying options in the compiler for agressivness of optimization.

07 Dec 2010

I was getting pretty consistent results with it. Int operations were a few cycles, floats were a few tens of cycles, and math functions were a few hundreds of cycles..If the for loops are tossed out, then the total iteration times for the loops would be much shorter and they would be constant.