We all are well know by the term “Dalvik” and its usage. Dalvik is a virtual machine (VM) for Android operating system. Java program which are compiled by Java compiler in bytecode and store in .class file which are given to dx tool for translating it into Dalvik bytecode which are store in .dex file. This dex file is then given to Android Assets Packaging Tool (aapt) which handles the packing process and .apk file is generated.
ART is successor of Dalvik. Android applications are compiled to Dalvik bytecode and run with ART. ART are used in the devices running on Android 5.0 and later.
Features in ART
- AOT (Ahead of Time compilation): This improves the performance of the app
- Improve Garbage collection: Improvement occurs by making concurrent garbage collections more timely.
- Gives more details on runtime exception: Instead of just showing java.lang.NullPointerException it shows the exception in much more detail like java.lang.NullPointerException: Attempt to write to field ‘int android.accessibilityservice.AccessibilityServiceInfo.flags’ on a null object reference
- Use Sampling Profile: Before developers used a tool called Traceview to track the app execution this used to slow down the performance considerably. Now ART uses Sampling profile without risking the performance of the app.