I have some code Im converting from java to c++ for the sake of improving speed. Everything that Im looking at converting is matrix or vector based arithmetic and so I was wondering if when Im returning values back to Java if Im negating the benefit of all the native code by returning my values back in the form of primitive float arrays. The way everything is written in java where I have to plug the values back into require that I extract everything out of an array coming back from jni and plug it back into the individual floats. This is no problem but when its all said and done will I be killing my gained performance by extracting values and storing them in individual floats. I could go through and change everything to use arrays but for ease of programming Id rather leaving all the existing code in place where possible.
So I suppose I would like to know if you take a performance hit when you deal with extracting values from arrays coming back from JNI methods in c++ and if so what would be the extent of the hit.