Android:What is ART?

背景:Android4.2之前,安卓手機系統的應用程序均在Dalvik Java的虛擬機上運行,這種運行模式還要依靠一個編譯器來實現與應用程序的溝通。應用程序每次運行時,都需要將程序內的代碼轉變爲機器碼才能運行,這無形中多附加了一道手續,這就造成了手機耗電相對較快,佔用內存大,用久了會卡頓的現象。

前言:KitKat(奇巧巧克力):雀巢的巧克力棒產品,最近Google宣佈最新4.4版Android將命名爲"KitKat"

One of the greatest features of Android 4.4.x KitKat, also probably the most under-reported one, is the next generation Android RunTime (ART).

翻譯:Android4.4.x KitKat 最顯著的特徵之一就是下一代的Android Run Time(ART),或許也是下一個即將被廣爲關注的特徵

What is ART?

翻譯:什麼是ART? (藝術)

When you start any apps on your Android device, the system actually takes some time and effort to compile the app package to machine code so your device can understand and execute. It does this Just in Time of execution. So as you run apps on your device, it actually keeps doing these resource intensive tasks in the background and this is a major reason why people notice Android apps are a bit sluggish when compared to their iOS counterparts.

翻譯:當你在你的Android設備上啓動任意app程序,系統都會耗費一些時間和精力(資源)去把該app包文件編譯成機器碼,以便你的設備可以理解並運行。這個過程在程序運行時執行。所以當你在你的設備上運行你的app程序,事實上,在後臺也同時運行着這些很耗費資源的任務。這也是和蘋果IOS系統相比,在Android系統上運行app程序會讓人感覺的有些緩慢的主要原因。
This is, until you switch to the new Android RunTime (ART).

翻譯:這個問題會一直存在,除非你換到新的Android Run Time。

With ART enabled, machine code compilations are done Ahead of Time during app installation. So when you run apps on your device, it can skip all that and simply executes the code directly.
翻譯:在ART啓用的情況下,機器碼的編譯會在app程序安裝過程中提前編譯完成。這樣當你在你的設備上運行你的app程序,它可以跳過編譯的過程,直接運行編譯好的機器碼。

The result? Reports show that ART yields performance improvements of around 10% to 20% on average. On the other hand it also boosts battery life because your device now does a lot less resource intensive machine code compiling. Take into considerations ART is currently a preview technology in Android 4.4.x KitKat so it can only get better and better in upcoming Android releases.

翻譯:這樣做的結果是什麼呢?報告顯示ART使得操作性能平均提高10%到20%。而另一方面,這也延長了電池的使用時間。因爲現在你的設備大大減少了執行編譯機器碼這一耗費資源的行爲。考慮到ART目前只是運用在Android4.4.X KitKat版本上,因此在未來發布的Android版本中ART只會越來越好。


英文原文截取自: http://www.mobilehiddencamera.com/

翻譯時間:2014年6月23日


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章