The Story of Android Lag and iOS Smoothness

In Android phone market manufactures are competing with hardware spec. In last few months we saw quad core processors, 1080p full HD displays, 2 GB DDR3 RAM, 72 core GPU and even Octa core processors as well.

While everything is going on like this, the Apple iPhone 5 still has a dual core processor and 1 GB DDR2 RAM. But the magic is iPhone 5 is performing as good as any latest muscle Android phone. What is the secret here?

the-story-of-android-lag-and-smooth-ui-in-ios-4016620

OS Architecture

iOS

the-story-of-android-lag-and-smooth-ui-in-ios-ios-layers-6473302

Android

the-story-of-android-lag-and-smooth-ui-in-ios-android-layers-6015285

Android architecture is almost same as iOS, but it has additional layer, Android RT. What is that? It’s coming up in next section.

App Development

iOS

iOS app development is done with objective-c, a simplified version of C, the most powerful programming language ever. It’s capable of natively working with core libraries and even kernel with much lesser overheads.

The problem here is not many developers are using C or objective-c. But with a polished up development tools and support Apple managed to overcome this problem. Today there is a huge development community around iOS.

Android

By the time Android came in to market, iOS was pretty popular and it had huge active development community. Android needed some strategic way to attract developers and Google decided to go for JAVA, the most popular programming language by then.

Unlike objective-c JAVA is not capable of working nativly with core libraries or kernel. It requires a virtual machine sitting in between. So Google came up with Android RT, a simplified version of JAVA RT to Android OS.

This system worked perfectly and lots of existing JAVA developers came in to Android app development market. Today Google play is even bigger than Apple App store.

Android Lag and iOS Smoothness

Now we know the architectural overview and app framework of Android and iOS. It’s time to sum up reasons for Android lag and iOS smoothness.

  • iOS runs native code (objective-c) and Android runs on byte code (JAVA) which need to be converted real time to native code through a virtual machine (Android RT). This is an extra overhead and common for all JAVA apps. Even in desktop computer there is a measurable performance difference between JAVA and C/C++ apps.
  • iOS has top priority process to render UI and Android has normal priority.

Andrew Munn

Android follows the traditional PC model of rendering occurring on the main thread with normal priority.

This is a not an abstract or academic difference. You can see it for yourself. Grab your closest iPad or iPhone and open Safari. Start loading a complex web page like Facebook. Half way through loading, put your finger on the screen and move it around. All rendering instantly stops. The website will literally never load until you remove your finger. This is because the UI thread is intercepting all events and rendering the UI at real-time priority.

If you repeat this exercise on Android, you’ll notice that the browser will attempt to both animate the page and render the HTML, and do an ‘ok’ job at both. On Android, this is a case where an efficient dual core processor really helps, which is why the Galaxy S II is famous for its smoothness.

  • iOS is very strict with multi-tasking. In early few versions it didn’t support it at all. Android supports to multi-task as much possible, but it lead to poor UI performance.
  • iOS has minimalistic set of features and user customization. Android let you to personalize UI with home screens, widgets and has wide set of features. They require significant processing power and eventually lead to poor UI performance.

Possible Solutions for Android Lag

  • With stronger hardware android also will be able to perform smooth as iOS and that’s why Android handset manufactures are focused on Octa core CPU, 72 cores GPU and DDR3 RAM. But this will lead to extra radiation and poor battery life.
  • Change the core Android architecture. This is a huge mission, next to impossible. With this, all the apps need to be re-written or Android has to support legacy apps.

In Android Jelly Bean, Google managed to increase the UI frame rate to 60 FPS which is promising. Now it’s par with iOS. But still there are occasional UI “hiccups” especially when you are dealing with network application.

To compete with iOS, Android must take some serious steps to optimize core OS functions rather than increasing hardware power. That’s lots of challenging work for Android development team. Let’s see how they are going to solve this.

Tags: #Android #Apple #Google #iOS #Performance