The graphic may misrepresent the actual numbers of iPhone users comparatively to the Android platform, but it certainly feels like over the last three years the Android platform has gotten bigger and bigger, capturing more mobile market share, with mods, apps, and number of hardware platforms running the software all ballooning. It is a major contender for the #1 mobile platform. But there are side effects to growth that fast. With finite resources, there are plenty of requested changes, plenty of potential improvements, that never get made in favor of keeping the lights on. The Dalvik runtime is one such bit of code in the android platform.
Dalvik is the process virtual machine (VM) in Google’s Android operating system. It is the software that runs the apps on Android devices. Having gone largely unchanged in years, Android has begun open beta of its replacement, the ART runtime, which promises better performance and battery life. Here’s how ART will deliver on that promise.
Android App Architecture
ART, which stands for Android Runtime, handles app execution in a fundamentally different way from Dalvik. DAlvik relies on a Just-In-Time (JIT) compiler to interpret bytecode, a generic version of the original application code. In a manner of speaking, apps are only partially compiled by developers, then the resulting code must go through an interpreter on a user’s device each and every time it is run. The process involves a lot of overhead and isn’t particularly efficient, but the mechanism makes it easy for apps to run on a variety of hardware and architectures. During Android’s explosive growth, with multiple major phone architectures and apps to support, this was a necessity!
ART is set to change this process by pre-compiling that bytecode into machine language when apps are first installed, turning them into truly native apps. This process is called Ahead-Of-Time (AOT) compilation. By removing the need to spin up a new virtual machine or run interpreted code, startup times can be cut down immensely and ongoing execution will become faster, as well. This is the primary reason why performance, battery life, and hardware utilization will decrease. Combine these fundamental improvements with better more complex hardware like the modern Samsung S4’s, and these devices could get even more powerful.
Thus far, estimates and some benchmarks suggest that the new runtime is already capable of cutting execution time in half for most applications. This means that long-running, processor-intensive tasks will be able to finish faster, allowing the system to idle more often and for longer.
Google sources say they have been working on ART in secret for two years. In fact, it was just under two years ago — May of 2012 — that the courts decided Google didn’t infringe on Oracle’s Java-related patents. So while ART may have been planned to speed up Android apps, I wouldn’t be surprised to hear that it got started because of the Oracle suit.
So What’s the Catch?
ART will require applications to be fully compiled on the device, which will usually mean apps will consume 10%-20% more storage space on your device. Also, expect longer install time for apps – the side effect of performing the AOT compilation. There are trade offs with either system, but improved battery life and performance will likely make more of a difference to consumers than the extra storage.
How Can I Test ART on My Device?
You can only enable it in Android 4.4 (KitKat) right now, through the Settings, Developer Options menu. Your device will reboot, and optimze all of your apps. Please note that this is a beta test, and some apps may break.
I, unfortunately, will not be able to check it out. After my original Droid X died, I replaced it with an iPhone 5. But I do believe this will go a long way in creating a truly native app experience for Android. Hopefully Google is treating ART as the launchpad to take a hard look at where the platform is, where it needs to go, and what will help them get there.
For more details about the ART project, check out Google’s page on the subject, and the links below.
- Android Police:Meet ART, Part 1
- Engadget: ART Experiment in Android KitKat
- GigaOm: Google starts testing ART, a potential replacement for Dalvik in Android
- Android Central – Five Minutes on ART, the new Android Runtime