| > 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. |
The only thing you are right about is that bytecode is more space efficient than native code.
Everything else is easily done in native code as well, it is just a matter of the OS providing support for it, there is nothing special about having to be a VM.