News for hackers. Stuff that matters.
Re:Nexus One running Android Froyo 2.2 is 450% faster than E... by jbellis on Wednesday May 12, 2010 @12:04AM (#1340139)
I understand why Google would want to use Java in their app platform. But if they didn't have the resources to get JIT working before now, wouldn't gcj (or hell, write your own java-to-machine-code compiler, clearly Google isn't scared of writing compilers) have been better than using a non-JITed VM?
Re:Nexus One running Android Froyo 2.2 is 450% faster than E... by Daishiman on Wednesday May 12, 2010 @12:43AM (#1340199)
The point of using a VM was to abstract away from specific processor targets, since embedded processors run from ARM to PowerPC, MIPS, x86, and others (and multiple variants of each processor, support additional instruction sets). This allows OEMs to produce an x86 port of stuff while keeping 95% of all apps which don't need native compilation.
Re:Nexus One running Android Froyo 2.2 is 450% faster than E... by nimrody on Wednesday May 12, 2010 @02:22AM (#1340320)
Well, you could always ship software in platform neutral code and make the final transition to native code when they are installed (either with something like gcj or use some intermediate representation like LLVM does).
Re:Nexus One running Android Froyo 2.2 is 450% faster than E... by theBobMcCormick on Wednesday May 12, 2010 @10:38AM (#1341030)
I think that would have it's own complexities. You'd have to ship each phone with a compiler and related toolchain. You'd also end up with two copies of each application installed on the users phone (one in the neutral format and one native). Sound like kind of a messy approach.

Really, the existing non-jit'ed Dalvik VM runs fast enough. If you think about it, their decision to ship a non-JIT VM and enhance the platform with JIT later is very much like Apple's approach with the iPhone of initially shipping the product without cut-and-paste and without any native API for third party apps, but then enhancing the platform later by adding those (and many other) features later. Both companies shipped when they had a platform that was "good enough", then have kept iterating and improving.

Re:Nexus One running Android Froyo 2.2 is 450% faster than E... by wgren on Wednesday May 12, 2010 @08:34AM (#1340755)
That is basically what JIT is. Why reinvent the wheel when they can use the resources that has been poured into JVM research?
Re:Nexus One running Android Froyo 2.2 is 450% faster than E... by jbellis on Wednesday May 12, 2010 @08:42AM (#1340766)
Except they can't, really. Dalvik is completely unrelated to Hotspot or any other JVM out there. (Remember that Android doesn't run Java class files natively, it's first compiled into dex.)
Re:Nexus One running Android Froyo 2.2 is 450% faster than E... by wgren on Wednesday May 12, 2010 @08:48AM (#1340778)
Right you are jbellis. Had forgotten that Dalvik isn't just a small JVM but a completely different architecture (register based, etc).

But anyway, what nimrody suggested is what they are doing - using platform neutral Dalvik bytecode and then transition to native through JIT.

Re:Nexus One running Android Froyo 2.2 is 450% faster than E... by s3graham on Wednesday May 12, 2010 @03:31AM (#1340419)
It's not quite that obvious. Compared to desktop/server where almost any jit is a win, there's substantial pressure on memory usage and battery life. An interpreter can do better on whole-system performance for both of those, without special care for when to run the jit, and how it's implemented.

I'm looking forward to seeing Bill Buzbee's talk on the JIT at I/O (of the most excellent http://www.homebrewcpu.com/ incidentally! :)

Re:Nexus One running Android Froyo 2.2 is 450% faster than E... by ergo98 on Wednesday May 12, 2010 @09:57AM (#1340933)
>But if they didn't have the resources to get JIT working before now, wouldn't gcj (or hell, write your own java-to-machine-code compiler, clearly Google isn't scared of writing compilers) have been better than using a non-JITed VM?

The Dalvik VM uses its own bytecode and all, so they would have to heavily modify anything existing.

Ultimately Android has been a work in progress. JIT is something that everyone has been asking for since day one, but there just aren't enough resources -- Apple is a $220 billion dollar company that is significantly hinged on the iPhone OS. The Android project, while relied upon by a lot of companies, is largely the work of Google that sees little to no revenue from it (their primary motivation, purportedly, was simply to ensure that there were options in the market).

Re:Nexus One running Android Froyo 2.2 is 450% faster than E... by cpr on Wednesday May 12, 2010 @12:36PM (#1341407)
Clarification: their primary motivation is so that they could ensure that at least some part of the mobile market could run their ads, they realizing that mobile is the future, and that ads are currently their only real source of income.
Re:Nexus One running Android Froyo 2.2 is 450% faster than E... by ergo98 on Wednesday May 12, 2010 @05:13PM (#1342288)
Absolutely true. As a business they don't want to be in a position where they can be cut out of the ecosystem.

That's actually an interesting facet of Android -- much was made recently about one of the open handset partners replacing Google with another search engine, but that's exactly how the platform is supposed to work. Google has no free in to all of the platform, beyond the add-ons like Google Mail that the partners would almost certainly want on the phone.