研究生: |
陳聖裕 Chen, Sheng-Yu |
---|---|
論文名稱: |
A Profiling Mechanism to Enhance Android Dalvik JIT through Co-operating with Ahead of Time Compilation Framework 混合JIT提早編譯策略與提前式編譯架構的Android Dalvik效能強化分析機制 |
指導教授: |
石維寬
Shih, Wei-Kuan |
口試委員: |
黃能富
曾紹崟 衛信文 |
學位類別: |
碩士 Master |
系所名稱: |
電機資訊學院 - 資訊工程學系 Computer Science |
論文出版年: | 2011 |
畢業學年度: | 99 |
語文別: | 英文 |
論文頁數: | 44 |
中文關鍵詞: | 嵌入式系統 、Android 、Dalvik虛擬機器 、即時編譯器 、效能分析 |
外文關鍵詞: | Embedded System, Android, Dalvik Virtual Machine, Just-In-Time Compiler, Performance Profiling |
相關次數: | 點閱:3 下載:0 |
分享至: |
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
Immediately after Google launched the Android software platform, hardware and software developers around the world started investing in Android-based research development projects, hoping to take advantage of business opportunities relating to the new platform. The result has been a recent increase in Android-based smart phones, and it seems that these devices will become increasingly popular over time.
However, one of the biggest drawbacks of the Android platform stems from its lackluster speed and performance. In response to this problem, Google has migrated a Just-in-Time compiler (JIT) to the latest version of the Android SDK (Software-Development-Kit). However, for a resource-limited embedded system like an Android smart phone, dynamic compilation will directly influence user-response time at startup, making deeper optimization levels unachievable. As a result, I propose a mechanism to speed up the Android application performance, which can serve as a complement to the Dalvik JIT and improve its performance. This mechanism sent Static-Time profiling information to Dalvik Virtual Machine,in order to reduce Just in Time Compiler (JIT) overhead of Profiling and Compilation in run-time. Then, appending an Ahead-of-Time compiler (AOTC): translate hot-spot code into native code to avoid VM`s Interpreter`s overhead in off-line. In addition, the Static-Time Profiling in this mechanism can base on the feature of Ahead-of-Time Compiler (AOTC) and Just in Time Compiler (JIT) to distinguish method categories. By combining the advantages of the two compilers, improve the Android application performance.
In this paper, I describe the implementation of each section in the mechanism. On average, our cooperating mechanism improves performance by 1.16 times the original JIT-only Dalvik Virtual Machine. While plus AOTC can improve its performance on average 3.05 times.
Google在2007年釋出了Android開放手機平台,吸引許多硬體、軟體開發者去研究,至今學界、業界皆投入相當的資源在Android嵌入式產品的研發,國內廠商宏達電、華碩、宏□等開發商亦推出了基於Android作業系統的智慧型手機與小型筆記型電腦且廣受國際市場歡迎;現在,平板電腦、電子書、甚至車用電子也皆以Android為作業系統的產品問世,不可否認,Android是個趨勢,也是國內在嵌入式軟體平台的一個機會。
目前Android平台的效能是被廣泛討論的議題,為了強調應用程式的高移植性,Google選擇了以Java作為其應用程式開發語言,並創造了名為Dalvik的虛擬機器(VM)和Run-Time Library來支援Java應用程式的運行;根據實驗比較,Dalvik VM的效能比其傳統Java VM在嵌入式系統上的表現,還有很多最佳化的空間;直至2009年11月,Google整合了Dalvik動態編譯器(JIT)至其最新的Code tree,來嘗試解決Dalvik效能低落的問題。
動態編譯器利用執行期間來做Profiling與Compilation的動作,除了有直接影響使用者反應時間的缺點外,因其在嵌入式平台的計算效能有限制,能產生code的quality以及執行Profiling的速度上也有瓶頸在;本論文提出一個完整機制來強化應用程式的執行效能,預先將Static-Time profiling資訊送給Dalvik Virtual Machine,以達成減少Just in Time Compiler(JIT)執行期間做Profiling與Compilation的overhead,並輔以一Ahead-of-Time Compiler(AOTC): 事先在off-line時將程式的熱門片段編譯成native code來避開VM直譯器的overhead;另外此機制的Static-Time Profiling能依Ahead-of-Time Compiler(AOTC)與Just in Time Compiler(JIT)的特性,將程式中的method分成適合AOTC或JIT兩種類,藉由結合兩個Compiler的優點,來提升整體Android應用程式的效能。
在這篇論文我們會詳細介紹各個部份的實作方式。數據方面,比起JIT-only的Android,加上輔助(無AOTC)能將其效能平均會提升16%。而加上AOTC的輔助能將其效能平均提升3.05倍。
[1] Google Android - An Open Handset Alliance Project, 2008.
http://code.google.com/android/
[2] Systronix Practical Embedded Java BenchMarks, 2009.
http://www.practicalembeddedjava.com/benchmark/11a/benchmark_android.html
[3] The World of Smalltalk,1999-2010
http://www.world.st/
[4] UCSD p-System Overview
https://www.msu.edu/~mrr/mycomp/terak/terpsyst.htm
[5] The Perl Programming Language,2002-2010
http://www.perl.org/
[6] CLSP – An AnSI Common Lisp Implementation
http://www.gnu.org/software/clisp/
[7] Common Lisp software repository
http://common-lisp.net/
[8] The Java Hotspot performance engine architecture
[9] M. Plezbert and R. Cytron. Doed just in time = better late than never? In Proceedings of the SIGPLAN`97 Conference on Programming Language Design and Implementation, January 1997.
[10] M. Burke, J. Choi, S. Fink, D. Grove, M. Hind, V. Sarkar, M. Serrano, V. Shreedhar, H. Srinivasan, and J. Whaley. The Jalapeno dynamically optimizing compiler for Java. In ACM Java Grande Conference, June 1999.
[11] M. Cierniak, G. Lueh, and J. Stichnoth. Practicing JUDO: Java Under Dynamic Optimizations. In Proceedings of the ACM SIGPLAN`00 Conference on Programming Language Design and Implementation, October 2000.
[12] Krintz, C. and Calder, B. Using annotations to reduce dynamic optimization time. In Proceedings of the Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation (Snowbird, Utah, United States, 2001). ACM.
[13] Krintz, C. Coupling on-line and off-line profile information to improve program performance. In Proceedings of the Proceedings of the international symposium on Code generation and optimization: feedback-directed and runtime optimization (San Francisco, California, 2003). IEEE Computer Society
[14] Vall, R., e-Rai, Co, P., Gagnon, E., Hendren, L., Lam, P. and Sundaresan, V. Soot - a Java bytecode optimization framework. In Proceedings of the Proceedings of the 1999 conference of the Centre for Advanced Studies on Collaborative research (Mississauga, Ontario, Canada, 1999). IBM Press.
[15] Java2C: A translator from Java to C language especially for embedded and fast realtime applications, including a javalike runtime System in C.
http://www.vishia.org/Java2C/html/features.html
[16] SciMark 2.0 : A Java benchmark for scientific and numerical computing
http://math.nist.gov/scimark2/
[17] Sun javac - Java programming language compiler, 2002.
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html
[18] Google Android Dx tool, 2007.
http://developer.android.com/intl/zh-TW/guide/developing/tools/othertools.html#dx
[19] Google Android SDK traceview
http://developer.android.com/guide/developing/tools/traceview.html
[20] AXMLPrinter2: Prints XML document from binary XML file
http://code.google.com/p/android4me/downloads/detail?name=AXMLPrinter2.jar&can=2&q=
[21] JesusFreke smali/baksmali: An assembler/disassembler for Android's dex format 2011
http://code.google.com/p/smali/
[22] Dedexer: A disassembler tool for DEX files.
http://dedexer.sourceforge.net/
[23] Pendragon CaffeineMark1997.
http://www.benchmarkhq.ru/cm30/