This post originally appeared on the uTest Blog.
As the smartphone battle heats up, a debate has begun around a seemingly crucial question: which platform is faster? In a lot of ways, that’s impossible to answer. Performance comparisons depend many factors, including the tradeoff between performance and battery life. But that hasn’t stopped some from having the debate anyway, and the battle lines right now are over Android’s JVM vs. the iPhone’s Objective C objc_msgSend(). Let me explain.
Android is a Java based platform and uses a Java Virtual Machine or JVM to execute apps (Android’s JVM is called Dalvik). Historically, Java was considered to be a slow and cumbersome platform. The joke was write once, run anywhere very, very slowly.
So people are saying that Android is slow, right? Actually, no. In fact, Java has been optimized so extensively in the past 10 years that its performance is now incredibly fast. Dalvik has been optimized even further for mobile devices, so Android is one fast platform. What people are actually saying is that the iPhone is slow.
To understand why, you have to dig deep into the world of Mac OS X esoterica. Apple software is written using Objective C, which is an object oriented version of C that uses messages instead of references like C++. (See the Wikipedia article to learn the nitty-gritty.) It’s like having every phone call go through an operator who relays on the message to the other person rather than just calling the other person directly. Why that’s the case for Apple software is complicated, but one can imagine that the message passing system, called objc_msgSend(), is a critical piece of software for anything written for OS X on the Mac or the iPhone.
Then again, all of this may really be beside the point. As former Java engineer Duncan Davidson mentions on his blog:
Fifteen years ago, all we thought that Java needed to rule the known universe was a faster VM. If we just had that, Windows and all native UI applications were toast. After lots of hard work by wicked smart people, and more than a few years, Java VM performance was increased to the point where it wasn’t a problem any more. But that didn’t change the equation of where Java did or didn’t succeed. Most notably, the Java GUI applications didn’t suddenly kick native Windows or MacOS applications to the curb. For quite a few of us that worked on the Java platform in the late 1990s—at least the more rabid of us—this came as a bit of a surprise. And a disappointment.
In other words, performance is one factor among many that defines whether or not a platform will succeed. Today we’re having a debate that the iPhone will suffer because Java is faster than C (that may be the strangest thing I’ve ever written), but in the end the relative performance of Java and OS X is only one small factor in market success. The hardware and software as a whole must supply a great user experience.
Fortunately, there’s a lot to love and be excited about when it comes to the user experience on both Android phones and the iPhone. With both iPhone OS 4 and Android 2.2 coming out in the next few weeks, we can expect some amazing innovations on mobile phones that make our lives better – performance improvements included.