The Dalvik VM is a register based machine that has been optimized for mobile application. The VM has been design to enable multiple instances to run at the same time, this improves the overall security and performance. Performance comparison of android versions, the test was carried on the Samsung Galaxy S GT-19000 : 1 Ghz ARM cortex A8 single core CPU : - 2.1 ECLAIR : 3.7 seconds - 2.2 FROYO : 1.6 second Those performance results show the real speed improvement brought by the JIT (Just In Time) compiler added in the Froyo version of Android delivered in may 2010. To get the maximum performance from the CPU, the only way is to use Native ARM code. The performance test between Java + Dalvik code and C code with ARM code was carried on an HTC Sensation Z710E / Pyramid : 1.2 Ghz ARM dual core CPU running the Gingerbread (2.3.3) version of android: Single task Dalvik java code : 1.6 second Single task Native c code : 0.8 second Dual tasks Dalvik java code : 2.2 seconds Dual tasks Native C code : 1 second Performance using JIT and using ARM Native Code  The native code is almost 5 times faster than the Eclair code (2.1 january 2010). Single Core versus Dual Core Dalvik code and Dual Core Native code running a two concurrent processes :   New Android phones using Intel ATOM processors (Z2460) are about to be delivered. In this case the development tools are able to compile the code in multiple formats : ARM, I86 and Java Dalvik pseudo code. Here is the diagram of the compilation and running processes. The android kernel choose automatically the native code according the processor type. In the Intel Atom case, if an ARM code is detected, this code is interpreted so the program is able to provide the proper service but at a performance cost. The ARM interpretor is less efficient that the Dalvik JIT machine (about 20 % less).
| Intel Z2460 1.6 Ghz | i86 | Dalvik | arm | | One Task | 0.69 | 0.953 | 1.165 | | Two Tasks | 0.777 | 1.337 | 1.488 | The intel Atom Z2460 is a single core processor with dual threads capabilities. | Galaxy Note 1.4 Ghz | Arm | Dalvik | | One Task | 0.558 | 1.064 | | Two Tasks | 0.564 | 1.361 | The ARM processor in the galaxy Note is a little more efficient than the intel. Furthermore, the Arm processor is a true dual core. And Now PC or Mac using Intel ships (Atom and Core 2 Duo) Using a Core 2 Duo 2 Ghz, the performance are : 1 thread = 0.275 second (one process computing 5000 digits of PI)2 threads = 0.279 second (two processes each computing 5000 digits of PI)4 threads = 0.557 second The same calculation on PC running Ubuntu 11.04 on an Intel Atom N 550 at 1.5 Ghz gives the following results : 1 thread = 0.665 second 2 threads = 0.7 second 4 threads = 1.0 second
This means than the CPU performance of the Apple A5 is better than the Atom N550 ( (2 physical cores and 4 logical cores) at a clock 50% higher. It should be underlined that the ARM achitecture is very efficient regarding the task concurrency performance. There is almost no difference between a single thread and two threads.
Intel Core 2 Duo P9400 2.4Ghz 1 thread = 0.151 s 2 threads = 0.160 s 4 threads = 0.320 s
ATOM 330 1.6 Ghz (2 physical cores and 4 logical cores) 1 thread = 0,655 s 2 threads = 0.660 s 4 threads = 1.035 s
Celerom 900 Mhz (1 physical core) 1 thread = 0.771 s 2 threads = 1.720 s 4 threads = 3.180 s
The Apple engineers have really done a great job with the hardware to achieve those performance. |