I've had a fun few days playing around with the Pi -- setting up Debian squeeze and then wheezy -- and just to get started I thought I'd mess around with various programs I've written in the past. Most of these are number-crunching simulations in C/C++.
What I noticed immediately was that some programs took an exceptionally long time to compile -- in some cases so long that I wound up killing the build process, as it was hogging all the system resources. Programs that did compile ran dramatically slower than on my regular laptop -- between 200-300 times slower in fact.
I'm not complaining at all -- it would be insane to expect the setup on the Pi to be able to come anywhere near the performance of an i7 processor -- but I was a little surprised to have quite such a large order of magnitude difference, and I'd like to try and understand why (and if there is any advice on writing Pi-friendly programs).
In the case of compiler speed, the programs that were problematic were fairly template-heavy C++, while C code seemed to compile fairly quickly. So I'm putting that down just to the much more intense effort the compiler has to put in for template-heavy code.
On the other hand, I don't have a ready explanation for the massive speed difference in running programs. At first I thought it might be due to software- rather than hardware-based floating point; a purely integer-based program was relatively faster, but still very slow (about 200 times slower as opposed to nearly 300 times slower for a program with a fair amount of FP). So I'm curious as to why -- and if there are any design choices I can make that might aid performance.
It may be clear by now that my understanding of hardware-related effects on code performance is not great. But that seems a good reason to play with something like the Raspberry Pi -- it's not just kids that can learn from this device ...
Thanks in advance for any thoughts or advice.