In order to decide whether it is justified to start porting an existed iOS app (written in C) to Android, I have to estimate how fast will it be, if being implemented in Java. Some concern is the fact that Java code must be translated many times (to bytecode, then to a native one using JIT). It may affect a real time property (responsiveness) negatively , right?
What about the quality of generated code? Is it somehow comparable with gcc/llvm generated code? If yes, do you have a reference to the comparison results (paper)?
Good question. Several years ago the performance of the Sun (now Oracle) JVM would pale in comparison to native code. But things have changed.
Firstly, the VM running Android isn’t your standard JVM. Its a beefed up VM rewritten by Google specifically for mobile use, where UI performance is given priority.
Secondly, a lot has happened over the past decade… a quote from this relevant article puts it nicely:
Fifteen years ago, all we thought that Java needed to rule the known universe was a faster VM.We now have a much faster VM.Finally, there’s been a lot written about comparisons between iOS and Android in terms of performance. Here’s a fifth link just for kicks. There’s plently more out there. It comes down to several factors – what type of code you need to run, what your performance expectations are, and how much you’re willing to invest to squeeze out the most bang for your buck. And if you think Dalvik is your bottleneck, you’re capable of writing native C/C++ and use JNI in Android.