前文「對 String 操作的改進」與「Android Dalvik VM vs. Java VM」談及基於 CVM 引擎的 Java VM 與 Dalvik 的效能差異後,最近 0xlab 內部也因為挑選硬體平台,持續分析 Embedded CaffeineMark 一類量化效能的報告。參考的硬體組態是 OMAP3/ARMv7 500 MHz,粗略的效能評比如下圖:
Dalvik 取自 0xdroid (cupcake + backported from donut),而 CVM-jit 則源自 phoneME CVM svn r19264,整體分數為:
- Dalvik VM : 1034
- CVM + jit : 7526
- cached constant
- cached constant inlining
- array init bounds check elimination
- Hardware fpu = NEON
- AAPCS
Four String methods -- charAt, compareTo, equals, and length -- areDalvik 理論上可施加這些優化技術 (string allocation / native method inlining),不過目前開放的實做中,尚未引入 (至少在 donut branch 中)。即便在保持 pure interpreter 的架構下,現有 class library 與 GC (garbage collector) 仍可作些調整,以改善 Android 的應用程式執行效能與 (圖形應用導向的) 使用者互動反應表現。
"inlined" by the VM, and are not going to get much faster.
There are probably a few others that could benefit from this
treatment, but I'm guessing that most string-centric processing in
Java will likely be dominated by the cost of String allocations. (The
above weren't inlined because of a measured performance need -- the
inlining was an experiment that needed a test subject.)
4 意見:
Jump to comment form | comments rss | trackback uri