which mentions speed but doesn’t seem to give a solid answer of how MOE on iOS compares to native Swift or Objective-C code.
I’m finishing up an Android app and am looking to port it to iOS, however there are pieces that require the highest performance possible, namely processing audio signals on the fly. Could I expect similar performance with MOE that I get with Android? Or is the overhead high enough that I’d run into issues?
I should note that the audio processing is done in Java on Android, I’m not doing anything with the NDK or anything, and the straight Java is satisfactory and I’m looking for similar performance on iOS.
the best way to assess the performance is to test it yourself. For your use case here is the MOE version of Apple’s SpeakHere sample:
It is basically a line by line port from Objective-C to Java.
You can take it as a template, copy over the audio engine part of your Android code and make it work with the iOS Audio API, so you can do the performance tests before starting to work on the UI.
To give you a more direct answer:
MOE 1.x uses the same code generator in ART that you are used to in Android. Your Java code will run as fast as on Android
MOE uses Nat/J to bind to the Objective-C APIs. Nat/J is built over JNI and it has some overhead compared to pure JNI. As you can see from the SpeakHere sample (and all the other MOE Apps), it still performs very well for most apps.
If it turns out that Nat/J is the bottleneck, you can define a direct JNI interface for your performance intensive Java -> native calls.