Android Kitkat ART vs. Dalvik & Impacts for end-users

[size=large][b]What's ART?[/b][/size]

ART is Google's 2-year-long ongoing secret project, which aims to boost the performance of our Android devices. It's based on the premise that modern devices are pretty powerful in terms of CPU speed and memory capacity, especially in comparison with the first generation of Android devices.

ART is still an ongoing project, considered too unstable to be introduced as a standard runtime.
You can choose to use it by going to "Settings > Developer Options > Select Runtime" and choosing ART.

[size=large][b]ART vs. Dalvik / AOT vs. JIT[/b][/size]

Dalvik VM (Virtual Machine) is Google's version of a Java VM (on which apps run). VMs keep apps isolated and independent from actual hardware and other apps. But, for this to work, Dalvik needs to convert so called bytecode (designed for virtual machine) to native machine code. In order to minimize the performance penalty that the bytecode to native code conversion introduces, a process called Just-In-Time (JIT) compilation is performed, which converts hot, i.e. often used, bytecode to native code.1

ART (Android Runtime) is a replacement for Dalvik that uses Ahead-Of-Time (AOT) compilation, meaning your apps are compiled to a ready-to-run state before you even launch them. This is usually done, at the time of app installation, making the process of launching and using them much faster and smoother. And since this means that compilation is only done once, you may also see better battery life, too.
[size=large][b]
Impacts for end-users[/b][/size]

ART is better on performance & battery life perspective, but you may not start using it, because ART is not fully functional with Android Kitkat. Google has shipped the ART perview with Android Kitkat for developers to test their apps on it. Maybe ART will fully functional with Android 5.0, Google's approach with ART is to beat iOS, that's the point.
[size=large][b]
Build device using ART[/b][/size]

Two runtimes are now available, the existing Dalvik runtime (libdvm.so) and the ART (libart.so). A device can be built using either or both. (You can dual boot from Developer options if both are installed.)

A new PRODUCT_RUNTIMES variable controls which runtimes are included in a build. Include it within either build/target/product/core_minimal.mk or build/target/product/core_base.mk.

Add this to the device makefile to have both runtimes built and installed, with Dalvik as the default:
PRODUCT_RUNTIMES := runtime_libdvm_default
PRODUCT_RUNTIMES += runtime_libart
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值