Products > Embedded Computing

Why is a PC so fast compared to BeagleBoard?

(1/7) > >>

I have some code with trigonometric functions and matrix multiplications. Floating point calculations are single precision.

When I run one calculations cycle on 180 MHz STM32 F4, it takes 145 us.
When I run it on 1 GHz PocketBeagle Cortex A8 it takes 50us.
But when I run it on my laptop with 1.8 GHz 3rd gen Core i5, it takes 1.8 us.

Why?? It seems fine that Beagle is 3 times faster than STM32. But why is the laptop 30 times faster than Beagle, being only two times faster??

Caches primarily, then effective branch prediction and speculative execution.

Compare the disassembled code. For matrix multiplication, compiler may have used SSE instructions on X86, which would make things multiple times faster right away.

Flash memory access alone acts like speedbrake for MCU, not to mention that embedded ARM cores are optimized for low power, not speed. Intel CPU's are heavily performance-optimized. - Deep pipelines, out of order execution, huge instruction and data cache memories. Why you think CPU of your laptop needs 35W of power? - Just to act like heater or what?

I suspect that either you have something odd in the compile options for the A8, and/or the Beagleboard is not running at 1GHz. Depending how you set up a Beagleboard, it may deault to a low clock rate, and require you to take action to push the clock rate up to 1GHz.  A Core i5 will be a lot faster than an A8, but the speed ratio you have seen is too big to be representative.

It really depends on the generated code. X86 floating point instruction set is much better than A8 FP ISA.


[0] Message Index

[#] Next page

There was an error while thanking
Go to full version