Question

I simply need to add floatArray1 to floatArray2 storing the result in floatArray2.. no third array.. all arrays are one dimensional but are very large... probibly as large as the os will let me get away with. Max i would need is two float arrays with 40,000 floats each... but i could get away with 1/10th that i suppose minimum.

Would love to do this in 1/30th or 1/60th of a second but that does not seem possible? Also if the code is JNI,NDK or OpenGL ES thats fine.. does android have an assembly language or like machine code i could use somehow?

Was it helpful?

Solution

Since a float is worth 32 bit and you have 40000 floats in each array you would need:

40000 * 32 * 2 = 2.560.000 bit

Which is 320.000 Byte. Not to much memory wise i would say since the default limit for an android app is 16MB.

Regarding performance you would definitely gain some speed using JNI. OpenGL would not give you enough benefit i would think since the OpenGL context creation takes some time as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top