, , and

Super-Rooted-Android
Everyone reading this no doubt loves Android, but how many of you know how Android runs? Android apps are written in the Java programming language but how is that converted into a language that can be read by our devices, considering the hardware is not powerful enough to have its own Java virtual machine?

Way back when Android was created, a mobile virtual machine was also created, the Dalvik VM. The Dalvik VM is a virtual machine that runs apps written in Java, the runtime. Android often struggled with multitasking in the early days, due to the intense nature of interpreting the Java bytecode and converting that to a machine-executable format. Google added a Just In Time (JIT) Compiler to the Dalvik VM. Without going into a lot of detail, a JIT compiler allows the virtual machine to pre-compile bytecode into machine language, and caching it for future use, thus allowing some code to execute natively, and thus, faster.

JIT sped Dalvik VM up considerably but it now seems that Google are looking to the future and want to make Android as smooth and as fast as possible.

With the release of Android version 4.4, KitKat, Google have released an experimental version of a new runtime, called ART. While the Dalvik VM compiler is employed as the application is running, that is, Just In Time, ART on the other hand generates the machine code from Bytecode and stores this for future use. This results in the code being compiled well ahead of time (instead of just in time), thus saving not only time at execution, but by making it more efficient this way it can also save battery life as less has to be done each time a process runs.

At this stage the default runtime compiler is still Dalvik, and ART is hidden away as it can break things, but it can be implemented within a ROM if someone wanted to test it out and provide some feedback to Google.

dalvik_art

A week or 2 ago we reported that Google had purchased Flexycore for a substantial amount of money and we were excited with Google thinking about speeding up Android even more. It now seems that Google may have purchased Flexycore so they can somehow help them in their development of their ART runtime compiler. While ART is still experimental, it can be implemented within the developer settings and while some are having more success than others it seems that some benchmarking has shown that ART is a lot faster and more efficient than DalvikVM.

chart_1

Ever wondered why iOS can be so smooth all the time? A big part of it is likely iOS’ use of native, machine level code — unlike Android where developers compile their Java sourcefiles to bytecode, iOS developers compile their Objective C straight to machine code, which executes rather quickly. It is the step of having to compile the code into a format that can run in Android that takes time. It is thought that Google’s idea is that using ART instead of Dalvik VM will save time and put it on a par with other mobile operating systems such as iOS and Windows Phone that use machine code. It is this part that seems to have everyone excited. Combine this ability to compile code beforehand with the superior processors and hardware in Android devices and we could be in for some exciting times ahead in the Android world.

The last few releases of Android have seen many under-the-hood enhancements and less of the whiz-bang glossy features that wow audiences. There have been many things that Google have introduced to Android that have made it run smoother and faster but this could be the most exciting thing to possibly come to Android in recent times.

Are you as excited as us about this development with Android as I am?

Source: Android SourceXDA-DevelopersReddit.
    8 Comments
    newest
    oldest
    Inline Feedbacks
    View all comments
    Chris

    Following Scott’s lead, I’ve actually converted my N5 from standard Dalvik to ART. The first reboot took almost half an hour as the system had to precompile each app on the system but once that was done, it does seem maybe that tiny bit faster, but it’s hard to know if that’s actually the case or just perception bias.

    Gregory Williams

    It’s my understanding from the reddit thread about this that the app has to actually support ART for it to work. Are you experiencing a lot of force closes in non-google apps?

    Montalbert_Scott

    interesting question- My N5 arrives tomorrow so will test it out then (don’t want to put my N4 onto 4.4 yet as i’d miss too many customisations)

    Graham Bae

    Apps don’t need ART support explicitly baked in, so most apps should work with no hitches. There are a couple of apps (Whatsapp and Titanium Backup) that have so far proven not to work with ART.

    I’ve tested the above on the 4.4 port on my Nexus 4 and can confirm.

    Just

    Tiny bit faster & much less power consumption perhaps? Notice huge difference in battery runtime?

    Sean Royce

    This is actually a little exciting, hopefully it improves androids speed. I have noticed that there are still little hiccoughs every now and then.

    Montalbert_Scott

    yes. it’s good to see that Google are not resting on their laurels. I can’t imagine them being able to improve much feature wise but this stuff under the hood can always be optimised more… faster, more battery efficient etc..

    Sean Royce

    Battery efficiency is something I’d definitely be wanting. Android has been known to be power hungry.