~ 19 Jan 2011, 10:11
It's been a benchmark week - I worked on two benchmarks simultaneously :)
A new version for the new year :) The website is http://anrieff.net/ucbench2011.
We're still cracking .RAR archive passwords and benchmark the cracking speed, however we're now 8-12% faster. And it has better CPU speed detection, equalized Linux vs Windows performance, and lots of tweaks and improvements on the website and the program itself.
I was following this article about using SDL on Android; however, it turned out to be a plunge in the wrong direction and I lost a few hours in fruitless attempts:
1) The SDL that gets compiled that way does not work with Android 2.2, it lacks /dev/tty0 and other related devices;
2) For some reason it requires root access. You have to root your phone. Also, as it does not create an .apk directly, you need to run the benchmark from the command line.
So, what I find out in the end was to simply use the latest SDL 1.3, directly sourced from the Mercurial repository. It has a wonderful README.android that explains it all. You just put your C/C++ sources inside a mock "Java"+JNI project, type a few commands and you get an .apk. Plain and simple.
The porting of Fract itself was also easy and I quickly got to this point:
The score is somewhat disappointing, especially considering the benchmark is run in reduced 400x300 resolution - so I delved into the generated object code and saw (to my astonishment) that the instructions were FPU-less, the compiler issued software floating-point code. Well, you can't assume a FPU on the ARM, but the newer devices do have FPU units (two, to be more precise - a VFP, which is similar to x87 in the PC world, and NEON, which compares to SSE1). So, to compile the NDK-part of your project with FPU support, you need to specify a slightly different architecture, using this build command:
I recommend you add V=1 in the end of that, so you can see what commands are being executed exactly. -mfpu=vfp is the relevant GCC option.
The two builds (FPU and non-FPU) can be found here:
Go test your android :)
Some results: a stock HTC Desire / Android 2.2 gets around 5.5 FPS. In comparison, Asus Eee PC 901, using the same fract sources and --no-sse --no-mmx --no-mmx2 --xres=400 --cpus=1 yields 11.7 fps. So far x86 wins :)