Android 2.0 ships with V8 JavaScript engine
Google has not yet released most of the Android 2.0 source code, but they did publish source for a very small number of components, including a WebKit snapshot. I was very excited to see that the snapshot includes Google's V8 virtual machine! (Previous Android releases used Safari's JavaScriptCore/"SquirrelFish Extreme" VM.) But without the rest of the source tree, there was no way to build and run this on a real Android phone. The SDK includes a binary image that runs only in the qemu-based emulator.
Today I got to try out a Motorola Droid. Here is how its browser compares to Android 1.6 on my HTC Dream (Android Dev Phone / T-Mobile G1) in the V8 Benchmark Suite (version 5):
Test | Dream | Droid | Change |
---|---|---|---|
Richards | 13.5 | 15.6 | 16% |
DeltaBlue | 5.23 | 12.9 | 147% |
Crypto | 13.2 | 10.9 | -17% |
RayTrace | 10.9 | 80.1 | 635% |
EarleyBoyer | 23.5 | 74.7 | 218% |
RegExp | did not complete | 16.5 | – |
Splay | did not complete | did not complete | – |
Some tests (Richards, Crypto) see little or no improvement, while others (DeltaBlue, RayTrace, EarleyBoyer) are dramatically faster. Just for comparison, let's run the same benchmark on Safari 4 (JavaScriptCore) and a Chromium 4 nightly build (V8) on a Mac Pro:
Test | Safari | Chromium | Change |
---|---|---|---|
Richards | 4103 | 4640 | 13% |
DeltaBlue | 3171 | 4418 | 39% |
Crypto | 3331 | 3643 | 9% |
RayTrace | 3509 | 6662 | 90% |
EarleyBoyer | 4737 | 7643 | 61% |
RegExp | 1268 | 1187 | -6% |
Splay | 1198 | 7290 | 509% |
The precise ratios are different, but the same tests that showed the most improvement from Android 1.6 to 2.0 also show the most improvement from Safari to Chrome. Based on this plus the source code snapshot, I'm pretty sure that Android 2.0 is indeed using V8.
This is exciting news. It makes Droid the first shipping product I know that uses V8 on an ARM processor, although V8 has included an ARM JIT compiler for some time now. For mobile web developers (like me), it means we're one step closer to having desktop-quality rich web applications on low-power handheld devices.
Final thought: Although the Motorola Droid is still 100 times slower than Chromium on a Mac Pro, it's actually faster at some benchmarks than IE8 on a low-end Windows machine, or Firefox 2 on hardware from just a few years ago.