It starts with pixels

Android performance 3: iPhone comparison

with 7 comments

The internet is just incredible. Within 30 minutes of logging onto the #iphonedev IRC channel on freenode, I got timing results for the iPhone on the simple loop benchmark from my last post. Thanks to ‘august’ for the help.

Here’s the benchmark converted into objective-C:

NSDate *start = [NSDate date];
int arr[8*320*480];
for(int i = 0; i < (8*320*480); i++)
arr[i] = i;
NSDate *end = [NSDate date];
NSLog(@"%g", [end timeIntervalSinceDate:start]);


  • iPhone (2.1 firmware, Objective-C): 9.5 milliseconds

And, from last time:

  • G1 (R29 firmware): 922 milliseconds.
  • G1 (R29 firmware): Loop only. 520 milliseconds.


Objective-C kills the Java implementation on Android.  It’s almost exactly 100 times faster.  Note that I’m unsure if the memory allocation is included in the timing, so a more conservative statement is that Objective-C can run a tight loop 50 times faster than the Dalvik JVM.  It’s also true that real applications aren’t full of tight loops, and a real Android application won’t be 50 times slower than an iPhone counterpart.  Nevertheless, all else being equal, it will be slower, and potentially a lot slower.

For now, we’re sadly going to put our Android development on hold and switch to iPhone, and keep an eye out for performance improvements.

Written by jeff

November 2nd, 2008 at 2:13 pm

  • Clem

    Your weblog posting is really intersting and fanstic,at the same time the blog topic is unique and ideal,excellent position.To your success.


    But problem is that Samson refused to take himself seriously or to take God seriously.… joy porn

    We see this clearly in his relationship with Delilah (Judges16). She continually tempts Samson while asking him to tell her the secret of his great strength, And rather than fleeing temptation.


    the next generation concept of nightlife located in the heart home to a number of friends and artists who quota nearly the same passions for ingenious communication.… teens strip drunk

  • kidney stones

    Hopefully they do a port of NativeClient to Android+ARM at some point. A huge amount of work, of course, but a big performance boost and arguably better than fiddling with writing yet another JIT from the ground up.

  • iPhone

    I find it always so strange that developers from android or Apple don't have this knowledge.

  • Eleanor

    I have always claimed to Java is a slow elephant – it's big and eats a lot of resources

  • Wire Spools

    What is the exact difference between Objective C and C++?