Android Runtime-ART vs Dalvik
While ART was experimentally launched with KitKat 4.4, Google has made it clear that ART will be replacing Dalvik as the Android Runtime for all apps. Currently, users do have the ability to switch back and forth between the two. Fortunately, ART has a faster runtime than Dalvik, as well as better performance.
Installation and Performance
Apps being installed on devices with ART runtime do initially take a bit longer to install. The reason being that the AOT compiler must first translate the information (DEX bytecode) into machine code during the installation, which causes the longer install time. However, since the DEX bytecode was translated during installation, it does not need to be translated again each time the app is run. This makes the app run faster overall on ART than it does on Dalvik. The performance time itself makes up for the longer installation time, as installation occurs only once.
Battery life and Storage space
Because the ART runtime uses AOT compilation (Ahead of Time), the CPU of the unit is free from translating DEX bytecode into machine code while the app is running, which leads to much less energy consumption and a longer battery life. The time between recharges can last substantially longer on ART than Dalvik, depending upon the apps used. When it comes to storage, however, apps on ART require a bigger footprint than on Dalvik. This is because the machine code that was translated by the AOT compiler is stored in the device’s storage.
Benefits for Developers
ART runtime comes with many benefits for developers. By translating the DEX bytecode during installation, it allows for all apps to be run faster. ART also has improved bug fix issues for developers as well. ART has support for dedicated sampling profiles within the apps. These profiles give an accurate view of the execution of the app, without any of the slow down that those using Traceview have experienced. ART has also improved garbage collection, such as allowing for one pause instead of the normal two, and will allow for a collector with a lower pause time. That will be for special cases of cleaning up the short-lived objects within the app. While ART currently doesn’t use compacting garbage collecting, the feature is under development in the android open source project, and will be made available once it is complete, making GC even easier. On top of these benefits, ART is also providing the app native crash reports in both Java and native stack information form, which allows for improved context information.
While there are some drawbacks to Google’s ART runtime (such as the longer app install time and the higher storage space), overall this update is better for developers and users alike than its Dalvik counterpart. ART allows for apps to run faster, and since it has the AOT compilation, also allows for a longer battery life for the device. The benefits to developers in terms of garbage collection and debugging improvements, really outweigh the drawbacks mentioned earlier.
Did you like it? Like it! Have something to say? Comment below! Want someone else to see it? Share it!