Saturday, June 21, 2014

Dalvik is dead: Next version of Android uses new ART runtime to boost speed, battery life

Dalvik is dead: Next version of Android uses new ART runtime to boost speed, battery life | ExtremeTech #colorbox,#cboxOverlay{display:none !important;}#leaderboard .lboard .topad{width:auto;}.article .title h2 ,.article{font-family: Helvetica,Arial,sans-serif;}.extreme-share{float:left;margin:0 5px 15px !important;}.tags .taglist li a {font:12px/15px arial !important;}.tags .title {padding:3px 0 0 !important;}.tags li a {display:inline-block !important;}.visual .switcher li {overflow:hidden;line-height:17px;}.etech-newsletter .btn-signup {cursor:pointer;}.etech-newsletter span.message {font-weight:bold;}.article strong {font: 16px/22px ProximaNovaRgBold,arial,sans-serif;}(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk')); document.write(unescape("%3Cscript src='" + (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js' %3E%3C/script%3E")); COMSCORE.beacon({ c1:2, c2:6885615, c3:"", c4:"", c5:"", c6:"", c15:"" }); ExtremeTechTop Searches:Windows 8AutosQuantumIntelTrending:LinuxWindows 8NASABatteriesAutomobilesZiff DavisHomeComputingMobileInternetGamingElectronicsExtremeDealsExtremeTechComputingDalvik is dead: Next version of Android uses new ART runtime to boost speed, battery lifeDalvik is dead: Next version of Android uses new ART runtime to boost speed, battery lifeBy Sebastian Anthony on June 20, 2014 at 8:32 amCommentAndroid ArtShare This article

The next major version of Android, which will probably be unveiled at Google I/O next week, will remove the Dalvik runtime and replace it with ART — the new Android Runtime. The main purpose of ART is to improve performance and smoothness of the core Android platform and stock apps, and third-party Android apps. Battery life and other core metrics should also be significantly improved. Brian Carlstrom, a member of Google’s Dalvik engineering team, announced the Dalvik-ART switch-over with this rather amusing patch note: “Dalvik is dead, long live Dalvik! DO NOT MERGE.”

Google first debuted ART back in November 2013 with the release of Android 4.4 KitKat. At the time it was an experimental feature that you could enable if you were feeling adventurous (Settings > Developer Options > Select Runtime). With lots of extra feedback from the community, and hundreds of patches since then, Google now seems confident that ART is ready to replace Dalvik entirely.

Dalvik and ART are fundamentally different beasts, compiling and executing code in very different ways. Dalvik primarily uses a just-in-time (JIT) compiler that compiles code when you run an app; ART uses an ahead-of-time (AOT) compiler that compiles to machine code when you install the app. In theory this can speed up execution time significantly, and thus also increase battery life and some other important metrics. ART also introduces better garbage collection, which should improve performance and responsiveness. For more technical details, the Android ART developer pages are pretty good. Developers may have to make a few changes to their apps/processes, but ART is mostly a drop-in replacement.

Early Dalvik vs. ART benchmarks, showing improvements in some areas, slowdowns in othersEarly Dalvik vs. ART benchmarks, showing improvements in some areas, slowdowns in others [Image credit: Android Police]

From an end-user perspective, the introduction of ART as the default Android runtime probably won’t blow you away. Early benchmarks show performance improvements (~10%) in some applications, but slowdowns in other areas. By the time ART is officially introduced, those slowdowns (due to bugs and incompleteness) should be gone. As with any big change, ART’s benefits won’t really shine until Google and third-party app developers optimize their apps. Presumably the next major version of Android (4.5 or 5.0) will be optimized for ART, and will thus the interface and stock apps will be very fast and efficient. The next major version could be unveiled at Google I/O next week (though I reckon the 4.4 branch still has a ways to run).

Android KitKatThe ultimate goal of ART is to make Android a slicker, more responsive platform — an area where iOS has historically dominated. There’s also the possibility that ART is a reaction to the ongoing court case between Oracle and Google over Dalvik — Oracle claims that Dalvik infringes on its Java IP, and so far it looks like Oracle will win the suit. By moving away from Dalvik, Google might save itself (and its developers) a lot of expensive, litigious hurt.

Stay tuned for lots more Android news next week. Google I/O runs from June 25 to 26, with a big two-hour keynote on the 25th that should cover a lot of ground.

Tagged In softwaremobile computingsmartphonesandroidoperating systemsdevelopersandroid 4.4artjavaDalvikcompilersandroid 4.5android 5.0jitShare This Article .article {margin:0px !important;}.AR_1 {margin :0 0 20px 0 !important;}.AR_2 {margin:0 0 20px 0;} CommentPost a Comment chojin999

The AnTuTu benchmark itself already shows that it’s going to be a +5% average performance increase at best… It’s more marketing than reality.
The compile-to-native-code it’s only partially true.. it’s still a virtual machine.. the improvements are really minor.

http://www.mrseb.co.uk/ Sebastian Anthony

Where are you getting your info from? As I have told you in the past, please don’t spread FUD without the necessary citations.

Also, those are very early benchmarks. I would expect to see much better figures for newer versions of ART.

There’s a possibility that this will be nothing — just a way to get away from the Oracle lawsuit. But that doesn’t mean it’s ‘marketing’.

chojin999

I really don’t care if you dislike me. Anyway it’s silly that you have to point it out everytime.

Anyone can see the numbers above. So when you don’t like the numbers you tell people (or just me) that those are not the truth.. or are you trying to claim that I can’t read the numbers above ?

Please..

Google is selling this thing as a revolution which is not. There is no real +50% nor even +20% average improvement. From the numbers above it’s going to be nothing more than +5% to +%8 average maybe… not even a solid +10%

So the benchmarks when they prove Google claims wrong are not to be trusted,uh ?

http://www.mrseb.co.uk/ Sebastian Anthony

Where did Google promise 50% higher performance from ART…? Where did it promise that ART would be a revolution? I thought it was just some developer-side thing that may speed Android up a bit, and make it more responsive?

(This is what I mean by FUD. If Google actually promised 50% publicly, then please link it here. If they didn’t say it, you shouldn’t spread falsehoods/FUD.)

chojin999

Your own previous article:
http://www.extremetech.com/computing/170677-android-art-google-finally-moves-to-replace-dalvik-to-boost-performance-and-battery-life
Quoting you ”

Android ART: Google finally moves to replace Dalvik, to boost performance and battery life

By Sebastian Anthony on November 8, 2013 at 4:49 pm

Now, with Android 4.4, Google has revealed that a Dalvik replacement is in the works — a replacement, called Android Runtime (ART), that should improve the performance of
Android apps by a huge margin. The early version of ART in Android 4.4 already speeds up apps by around 100%, and the final version should be even better. “

http://www.mrseb.co.uk/ Sebastian Anthony

Ah-ha! Odd. Not sure what I was citing there. It could be a typo of 10%.
Or I might have been referring to certain functions that are more than 2x faster: https://docs.google.com/spreadsheet/ccc?key=0AnE-DX9Fbr9KdFZtRlhQaWxmVG5XdDR3TFR1Q3JONnc&usp=sharing#gid=0
But yeah, I would expect ART to bring a fairly sizable performance boost, overall.

JD Rahman

Hell has frozen over. Pigs are flying and I’m going to get laid. Chojin was right…?

Phobos

Or could be a sign of the coming Apocalypse? Usually Chojin spreads FUD like crazy but this time he nail it! Spooky.

szatkus

Don’t look only at benchmarks. JIT can cause micro-stuttering during using an app. With AOT everything is already compiled.

Sean Lumly

I’m not sure about all situations, but micro-stuttering is often caused by the periodic garbage collector sweep. A careful developer can avoid letting go of object references to reduce these pauses. But this is a runtime problem, not one of compilation methodologies, and I doubt that ART would help much in this regard.

I would love an option in Java to have the ability call the GC rather than have it automatically run when there is little danger of a disruption to the user (eg. right after a final OpenGL draw call).

szatkus

There’s System.gc() in Java, but it’s only a suggestion. I’m not sure how well it works in Dalvik, I’m not a Android programmer.

Sean Lumly

Indeed! It may also be acceptable to mark objects for clean-up, which may reduce stack/heap-sweep duration. But the point is: a little control (for those that could use it) could be very helpful!

Sean Lumly

The boosts seem modest, but any improvement is an improvement, right? Even though small (eg. 5% – 10%), they may reduce the workload enough to have a noticeable effect on battery life.

Another benefit that users may notice is far quicker app launch times! I’ve noticed that only a handful of Android apps spring open when called upon, while most have a perceptible period of pause. A reduced requirement of JITing may be beneficial in this way.

chojin999

Apple changed a lot on iOS with iOS 8 *BUT* Swift is going to give a +50% average performance boost compared to Objective-C and then the Metal API I doubt are going to be anything less than a +30% to +50% faster on average than OpenGL ES 3

Sean Lumly

iOS implementation is a different topic altogether.

I’m not sure about Swift, but Metal apps that are draw-call bound will certainly be faster, those that aren’t will likely not see any improvement.

darkich

The fact you used antutu as an example here tells me you are just trying to trash android for some reason.

Why not use a comparative data from the charts and graphs you provided in the comments below( showing about 50% improvement from Dalvik) ?

So in the on of the day, you are actually criticizing Google for making an undeniable improvement in its VM.
Fascinating

chojin999

Me? I used the AnTuTu benchmark ? Did I write the article above, perhaps? Please…

There have been comparative tests of ART Vs Dalvik Vs Native C and without a virtual machine native C compiled code runs 3 times faster on average than ART.

Then if you want to negate reality and claim that Android is going to be faster or as fast as native C code with ART then go on.. fact is that it’s not true and it’s not going to happen.

You must be delusional hoping that ART could give a +50% improvement over Dalvik. That is not going to happen at all.

John

>> It’s more marketing than reality.

Wow, what a complete crock of sh*t.

There are limitations to ART, yes. This is an incremental improvement, not some drastic, game changing revolution. But to say ‘its more marketing than..’ is total nonsense. Its like you got tired of hearing people call out apple for their bullsh*t over-hyping of the 64bit migration, and just *want* to accuse google of the same thing. Sorry, google is not pulling an apple. Both companies are making improvements, but only apple is actively deceiving their logic challenged cheering squad with over-hyped marketing BS.

chojin999

Using foul language here is not going to prove any of your points not to make ART run faster. That is for sure.
Insulting me it’s not going to do anything either.
You are the one hating Apple here so much. And you want to believe the wonders of Google that are just not there. So now ART it’s not going to improve Android much and you tell that that wasn’t the plan at all.. sure. The marketing hype put on the ‘net on ART by Google must be a dream then…
Despite how much you hate Apple it’s a fact that Swift it’s a lot faster than Objective-C. And it’s a fact that the Metal API are going to be a lot faster than OpenGL ES for 3D, with main commercial 3D engines already supporting it.
And it’s a fact that Android ART is not going be a lot faster despite any Google claims. Google should ditch the whole Java virtual machine thing and go all native C/C++ to achieve the best performance on their devices. But obviously that would mean rewriting Android from scratch.. a completely new OS based on Linux or something else.

tgrech

ART ran less than perfect on my MotoG, some apps(Like DraStic) wouldn’t run at all. Hopefully this’ll be fixed by then.

Asdacap Cap

Personally I think the biggest gain from ART is not benchmark wise performance, but the fact that when you touch the launcher, the app is already compiled. So in theory (I think) if the app is not loaded in RAM yet, it will start faster with ART.

szatkus

” There’s also the possibility that ART is a reaction to the ongoing court case between Oracle and Google over Dalvik”
Wait, how? It’s still Java (kind of, it never was compatible with Java standards), just execution changed.

John

I’m also very curious about this.

Asmodai

My hope is that Google will launch two new versions of Android at Google I/O next week. Lets call them Android 4.5 and Android 5.0. Android 4.5 will be the continued evolution of what we have now and be 32bit and default to Dalvik. Android 5.0 will be 64bit only and will default to ART.

Sean Lumly

Not to toot my own horn — though who are we kidding, this is exactly what I am doing — but I remember suggesting a scheme identical to the ART compilation scheme way back in the Android 2.x days, specifically to overcome the performance shortcomings of the JIT (both startup and execution). It was met with hostility and insults.

But now I make a new provocation: I hope that the compiler team has thought ahead about de-coupling the compiler from being exclusively Java driven. There are situations where it is possible to write code for higher performance in alternative languages (eg. dev controlled garbage management) without sacrificing portability. Renderscript (AFAIK) aims to accomplish this, but seems more suited to certain types of strategies, and leaves little control over the execution target, which may be better determined by the developer.

But I believe this is a step in the right direction. If Google were really clever, they would consider a distributed solution for the problem of compiler optimization for commonly downloaded apps! Even with a brute force algorithm (spread over millions of android users), this could automate parts of the optimization problem in a platform agnostic way.

chojin999

It’s always just a virtual machine. Even when writing any C/C++ code with pointers everything gets translated to virtual machine code which can be put at an higher priority than the java code but it will never run as fast as a real C/C++ compiled code that doesn’t run in a virtual machine environment.

Sean Lumly

Something compiled to a binary for native execution generally does not use a VM. Unless I’m mistaken, native compilation is at the heart of ART (corrections welcome if this is the case).

chojin999

http://eklausmeier.wordpress.com/2013/12/30/performance-of-dalvik-versus-native-c-compilation/


December 30, 2013 by Elmar Klausmeier

Performance of Dalvik versus native C compilation

Android application programs are usually written in the Java programming language. Java source code is compiled to bytecode, which is then interpreted by the Java virtual machine. Current virtual machines (VM for short) use two tricks to improve performance:

compile bytecode to machine code during run-time (JIT: just-in-time compilation)

optimize machine code according usage pattern (hotspot technology)

Despite all these tricks native code produced by C/C++ compilers is ways faster than JIT/hotspot, see for example shootout from 2008, or see The Computer Language Benchmarks Game.

[...]

Google bought FlexyCore to improve their performance of Dalvik. With Android KitKat one has the option to switch to ART, the new runtime environment which improves performance of the execution of Java binaries.

See below picture in Dalvik vs. ART vs. C for a recent performance comparison between Dalvik versus ART versus
plain C, still showing a gap of factor 3 between Dalvik and plain C:

http://eklausmeier.files.wordpress.com/2013/12/dalvikartc.png

https://docs.google.com/spreadsheet/ccc?key=0AnE-DX9Fbr9KdFZtRlhQaWxmVG5XdDR3TFR1Q3JONnc&usp=sharing#gid=0

Sean Lumly

What in the world gave you the impression that I was comparing Java (Dalvik or ART) performance to native C???

chojin999

“Something compiled to a binary for native execution generally does not use a VM” … what were you trying to compare it to then? Other slow languages for the which the compiled code doesn’t run in a virtual machine?

Sean Lumly

I see where you’re confused. The second sentence of that message will lend some clarification. I was never comparing Java performance to a native language like C.

howardbamber

Very true. Either way us clumsy, inelegant, resource wasting. There will be no gains, aoart from the financial saving of one less court case. Chrome phones anyone?

Nicolas Klein

Sebastian: Does this affect developers in any way?
How will it affect c++ Native developers?
And lastly: ow does thiss affect load time (which isn’t specified on the benchmarks)

Changing topics: I sent you a Facebook message since I have a private question for you, would you mind answering it (or at least telling me you won’t so I can stop annoying you with this issue)

Bryan_S

I have been running my N5 with ART enabled since about a month after I got it. ( I got it 2wks after launch) I have kept ART enabled… because it is noticeably quicker. Don’t go off a single benchmark made from purposefully unoptimized code… give it a spin then make your judgement.

http://www.mrseb.co.uk/ Sebastian Anthony

Cool, thanks for the info :)

dc

when will get a version that allows the end user to pick chinese, russian or NSA spyware? Right now its just a shot in the dark as to which version you will get.

Sanjay Negi

Awesome, really nice.

http://www.techgreet.com/

FollowFollow @ExtremeTech!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
ExtremeTech Newsletter

Subscribe Today to get the latest ExtremeTech news delivered right to your inbox.

More Articles samsung-840-evo-angle-1tbET deals: Samsung 840 EVO 1TB SSD for $400 Jun 20Supreme CourtUS Supreme Court deals major blow against software patents and patent trolls Jun 20KIT's mechanical invisibility cloak, with a finger on topThe first ‘unfeelability’ invisibility cloak will please campers and princesses everywhere Jun 20extremetech-tmo-datastrongT-Mobile Un-carrier 5 and 6: Free iPhone loans, VoLTE, and unmetered music Jun 20AMD Trinity APU die shot. Piledriver modules and caches are on the left.AMD claims it can deliver 25x energy efficiency improvement in the next six years Jun 20 About ExtremeTechAdvertisingContact ExtremeTechET ForumsTerms of UsePrivacy PolicyZiff DavisJobs AdChoice/**/var _bap_p_overrides=_bap_p_overrides||{};_bap_p_overrides[8]={new_window:true}; (function(s, p, d) { var h=d.location.protocol, i=p+"-"+s, e=d.getElementById(i), r=d.getElementById(p+"-root"), u=h==="https:"?"d1z2jf7jlzjs58.cloudfront.net" :"static."+p+".com"; if (e) return; e = d.createElement(s); e.id = i; e.async = true; e.src = h+"//"+u+"/p.js"; r.appendChild(e);})("script", "parsely", document);

Use of this site is governed by our Terms of Use and Privacy Policy. Copyright 1996-2014 Ziff Davis, LLC.PCMag Digital Group All Rights Reserved. ExtremeTech is a registered trademark of Ziff Davis, LLC. Reproduction in whole or in part in any form or medium without express written permission of Ziff Davis, LLC. is prohibited.


This post was made using the Auto Blogging Software from WebMagnates.org This line will not appear when posts are made after activating the software to full version.

No comments:

Post a Comment