Blog

20 06/10
18:20

iPhone 3G, 3GS and 4 linpack benchmark results

Inspired by theĀ Android linpack top 10 chart I set out to compile the linpack benchmark for the iPhone and try it on the 3G and 3GS. What I found surprised me.

I used a C implementation of the linpack benchmark fromĀ www.netlib.org to create the app.

To be clear, I don’t really know what the Android Java linpack benchmark is doing and how it relates to the C implementation I used so I have no idea how the numbers I got compare to the Android numbers. It also appears some of the reported Android numbers were manipulated by some users as a prank so it’s difficult to tell what is real and what is not.

That being said, what’s interesting is not the performance difference between iPhone and Android, especially since the Android phones are newer than these iPhones models and Apple will announce a new device tomorrow which should be viewed as a comparable competitor to the latest Android phones. With any luck, I’ll benchmark the new iPhone in the near future. What I find interesting is the performance differences between the 3G and the 3GS.

I ran the benchmark on a 1000×1000 matrix (see the linpack benchmark documentation to read about this) both in single precision and double precision modes with what I believe are the fastest code generation settings for the two devices.
I also have iPhone OS 4 Beta 4 installed at the moment which may not be ideal for performance testing as Apple beta’s can sometimes slow things down. Also, the multitasking in iPhone OS 4 on the 3GS may have an effect as we’ll see below.

Double precision Single precision
iPhone 3G 20.6 MFlops 28.5 MFlops
iPhone 3GS 18.2 MFlops 27.3 MFlops

And there you have it, the 3G and 3GS have essentially equivalent floating point performance. The 3GS actually shows a 10-12% disadvantage but this could be a result of the beta OS or the increased multitasking that occurs on a 3GS. I would guess they are essentially equivalent.
Based on these numbers it appears that the 3GS’ speed advantage over the 3G is strictly in the integer realm. Floating point performance is the same.

Update:

I’ve run the benchmark on an iPhone 4. Here are the results:

Double precision Single precision
iPhone 4 20.9 MFlops 36.2 MFlops

iPhone 4 has somewhat better single precision floating point performance while double precision is the same. This benchmark does not explicitly utilize the ARM NEON SIMD instructions available through the Accelerate framework. Apple claims (in their WWDC presentations) that NEON can provide an up to 8x performance gain for single precision floating point operations. So that 36.2 MFlops figure could be significantly improved by modifying the code to use iOS4′s BLAS libraries (assuming the very optimistic full 8x speedup that’s ~290MFlops!). NEON does not support double precision operations so those are relegated to the ARM VFP which has the same performance as the 3G/3GS devices.