Iyo/RPi benchmark conundrum
GavinWraith (26) 1563 posts |
In Archive 23/4 I wrote an article about Charm and included some benchmarks comparing C, Charm, RiscLua and Basic on the Iyonix with two test programs. One, FNCALL, did 10,000,000 function calls, the other, SIEVE, used Eratosthenes’ sieve to generate the first 1000 primes a 1000 times. I have now run these (without recompilation) on the RPi for comparison. Most of the results show the speedup one might expect – spectacularly so in the case of SIEVE in C and Charm where the time drops from 37 centiseconds to 7 and from 36 to 13 respectively. But there was an anomaly: for SIEVE in Basic the time rose from 1113 centiseconds to 1123. |
neil.r (1738) 66 posts |
Note: I’ve not tested this on RISCOS yet – but on Raspbian, passing -mfloat-abi=hard to gcc did the trick. For soft floats, it’s -mfloat-abi=softfp Like I say, I’ve not tried either of these on RISCOS yet. I used both methods a few months ago calculating pi on a pi to see the effects of different ways of handling floating point stuff. Not surprisingly, it made a big difference. |
neil.r (1738) 66 posts |
Firstly, please forgive my hopeless newbie-ness. I’ve only been using gcc on RISC OS for 2 days. And anyway, what I know about gcc could be written on the inside of the ear of a small mouse. Since typing the above reply, I dug out my old pi_css5 test program that I used originally, and played with it. Firstly, tried compiling with -mfloat-abi=softfp:
mmm, not exactly what I was looking for. So, let’s try -mfloat-abi=hard:
Better, but still nothing I can really do anything with. So, in the end I just removed the -mfloat parameter, and let gcc get on with the floats itself. The program compiles OK, but is desperately slow to execute. By way of comparison, using -mfloat-abi=hard on Raspbian Wheezy calculates 131072 digits of pi in ~7 secs. On RISC OS with gcc handling the floats, it’s ~80 secs. Which isn’t surprising really, but I’d like to be able to pass the floats off to the hardware rather than emulating them in software. |
Chris Gransden (337) 1207 posts |
The version of gcc you’re using doesn’t support producing hardware floating point binaries. It uses the old fpa softfloat library which as you’ve noticed is very slow. pi_css5 131072 takes 1 second on a Pandaboard @1.6GHz and 5.22 seconds on a Raspberry Pi @950MHz. |
neil.r (1738) 66 posts |
Ah, thanks for confirming that. I also learned to RTFM1 which led me to the fact that -mfloat-abi=hard and =mfloat-abi=softfp were never going to work anyway… Hey ho. Learn something new every day :) 1 http://www.riscos.info/index.php/GCCSDK_Development Ta, |