Tomek Kondrat · Feb 2, 2014 at 07:00 pm

The ART of Android

Android 4.4 KitKat is indeed a sweet update. It brought dozens of new features, and its decreased memory footprint allowed it to be ported to older devices relatively easily. One of the most interesting features hidden deep inside developers options is ART, a new runtime compiler poised to replace our good friend Dalvik. What is ART and why should you be interested in it? Let’s dig deeper.

Android uses a virtual machine to execute code. It’s not a perfect solution. And because of this, Android devices need more resources to run smoothly than for example Windows Phone. Dalvik, which is the default runtime, is nothing more than the software that runs the applications on Android devices. Ever since Android 2.2, Dalvik has used a Just-In-Time compiler to interpret bytecode from Java language. Programs written in Java are then converted from a Java class files to a Dalvik Executable (.dex) before installation on a device. An odex is basically a pre-processed version of an application’s classes.dex that is execution-ready for Dalvik. When an application is odexed, the classes.dex is removed from the APK archive, and nothing is written to the Dalvik cache. An application that is not odexed ends up with 2 copies of the classes.dex file: the packaged file in the APK and the processed one in the Dalvik cache. It also takes a little longer to launch the first time since Dalvik has to extract and process the classes.dex file. And for reference, the name Dalvik comes from the name of the fishing village Dalvík in Eyjafjörður, Iceland, where the ancestors of Dan Bornstein (the creator of Dalvik) lived.

Dalvik is still a great project, but the Android developers decided to swap it for a higher performance runtime compiler: ART. This new runtime uses Ahead-of-Time compilation, where the bytecode is precompiled into machine language at the time of installation. That explains why applications installed with ART enabled take longer to install and less time to open. They also require more space, but this shouldn’t be a problem as almost all new devices have tons of internal storage. ART was introduced as an experimental feature in Android 4.4.In its current form, ART is not unequivocally faster than Dalvik in all benchmarks. However, we need to keep in mind that this runtime is still very new and optimization will take time.

According to newest commits in master branch of Android, ART will replace Dalvik in the next version of Android. Dalvik will still be available as an alternative runtime virtual machine to keep compatibility with certain older applications. You might have noticed that some applications like WhatsApp had some issues when Android 4.4 was released, especially for those running ART. However, these were mostly solved quite quickly, and now most apps works flawlessly on ART. This runtime compiler is definitely worth trying, but it is important to keep in mind a few potential cons like bigger apps and some problems with certain applications. That said, it’s a great feature that will only be tweaked further in upcoming releases.

You can read more about ART in an informational thread created by XDA Senior Member PradeepMurugan, who gathered together quite a bit of information and put it all in one place where most of highlighted issues are already covered. The next version of Android will be something big, and hopefully ART will be optimized enough to leave the Dalvik in the dust.

[Thanks to Nathan Strong from Stackoverflow for providing a complete definition of ODEX]


_________
Want something on the XDA Portal? Send us a tip!

Tomek Kondrat

eagleeyetom is an editor on XDA-Developers, the largest community for Android users. Tomek is the only Polish moderator on XDA Developers. He graduated from the University of Warmia and Mazury in Olsztyn with a degree in journalism and public communication in 2013. He's a big fan of football (not hand egg), post rock and cooking. A total addict of mobile technology, especially Android. Currently flashes dozens of custom ROMs on his OPO. View eagleeyetom's posts and articles here.
Mathew Brack · Mar 30, 2015 at 09:00 am · 2 comments

What’s Next For Pebble?

It is all well and good stating figures, but what does $20 million of crowd funding mean for a company? The Pebble Time just recently ended their Kickstarter with over 4000% of their initial request which was just $500,000.  This level of funding is unprecedented for Kickstarter and it passed $1 million in less than an hour bringing with it a level of fame unavailable to many other OEMs.     Produced by the Pebble Technology Corporation (PTC), the Pebble Watch has...

XDA NEWS
Jimmy McGee · Mar 30, 2015 at 06:00 am · 3 comments

LG G4 Note Picture Leaked, Oxygen OS Delayed – XDA TV

The LG G4 Note has been leaked! That and much more news is covered by Jordan when he reviews all the important stories from this weekend. Included in this weekend's news is the news of the delay in the release of Oxygen OS and be sure to check out the article talking about installing Android 4.4 Kitkat on a laptop. That's not all that's covered in today's video! Be sure to check out the other videos released earlier this week...

XDA NEWS
Emil Kako · Mar 29, 2015 at 06:47 pm · 4 comments

Has ART Made a Noticeable Jump in App Performance?

We've received mixed reports about switching to ART but it seems that the majority of users who make the jump see some type of improvement. But just how noticeable is this improvement in app performance? Let us know if switching to ART has brought noticeable changes to your device's performance.

DISCUSS
Share This