2

When using Google Chrome mobile (or any other android web browser) is the Javascript VM running on top of the Java VM? Or is the JS code compiled to Java bytecode?

I ask this because JS seems to run obnoxiously slower on Android using Google Chrome vs a PC. Granted a PC is much faster, but I have a Galaxy S3 which should be on par with a 2yr old netbook right?

  • 1
    Not sure why this was closed. I'd think a question about the performance would be on-topic. Certainly it's not obviously off-topic. – ale Jan 18 '13 at 14:37
  • I agree, and I don't think this question is unanswerable, per the close reason. The main questions (Is the Javascript VM running on top of the Java VM? Or is the JS code compiled to Java bytecode?) do have a specific answer that can be answered with sufficient research. – Lie Ryan Jan 18 '13 at 14:53
3

The Javascript engine in Android's Browser/WebView can be either JavaScriptCore (lower end phones) or V8 (higher end phones). Chrome also uses V8. Both engines are written in C++.

Javascript is never compiled to Java bytecode, instead it is interpreted and/or JIT compiled into ARM bytecode.

My guess on why V8 on PC is much faster than V8 on Android is probably because JIT compilation to x86 is more mature than JIT compilation to ARM.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.