| > Android's architecture keeps code small, makes sure nobody eats the global heap, shares common bytecode (really, anything) pages across processes, and provides memory-conserving modularity tools within each VM instance's heap. Global heap can be controlled by process in many OS, nothing special about VMs. Sharing of code pages between processes has been done in mainstream OS since a few decades. Memory-conserving modularity tools, whatever that might be, aren't VM specific. The only issue you are right about, is that bytecode is much more compact than native code. > ... the reason there hasn't been a lot of new work on the JIT may be that the JIT is as good as it can be without eating more battery. The current JIT is good enough for developers writing CRUD applications, HTML wrappers or the "fart app" of the month. Those of us that care about performance use the NDK anyway. |
If you had said "People porting game engines implemented in C use the NDK anyway" you might be right, and they do that because re-coding the game engine is impractical, not for performance. But the implementation of large systems in Android is best done in Java, for reasons of performance, modularity, and power efficiency.
Managed language systems exist for a reason. Dalvik bytecode is much more space efficient than native code, and Google has claimed it is about 2x as space efficient as Java bytecode, and 2x faster to interpret. Those factors reduce the need for a JIT in Android, and, until Android 2.3, Android didn't have one, and there were plenty of ambitious, performance-sensitive Android apps.
The Android component architecture enables a kind of code swapping that enables large apps to fit in a single process with a limited heap size. If you are not making use of component objects, you are not being memory efficient.
Android's Zygote and the use of copy-on-write goes beyond sharing pages of "pure" code. Any page can be shared between processes this way. This keeps global memory use down and makes it efficeint to start many more processes that would otherwise be practical with a VM language.
The Android base classes, Java toolchain, and runtime are the most sophisticated and efficient managed language environment for mobile devices. Ignoring them and going straight to NDK code without a specific performance case based on measurements of Android Java code performance, the effects of the JIT, and code size is a waste of time and a source of bugs that will be harder to find and fix.