Code Index 5 released
Update
- Add test to compare JNI array access method.
- Reduce case in byte array copy/fill.
- Test time per case increased to 2 sec.
JniGetReleaseByteArray @ Samsung Galaxy Note 2
Observations
- Access time does not affected by array size.
- Access time does not affected by JNIABORT flag.
- Get/ReleasePrimitiveArrayCritical is slower than Get/ReleaseByteArrayElements.
- In short array, using stupid Java for-loop is better.
Facts
- Android src: dalvik/vm/Jni.cpp, Line 2351, 2594.
- Implementation does not care JNIABORT.
- Array size may affect the cost in native pinPrimitiveArray call. But I am not sure.
- isCopy arg just output false.
- Implementation of Get/ReleasePrimitiveArrayCritical and Get/ReleaseByteArrayElements are the same. However the Get/ReleasePrimitiveArrayCritical output void*. May be that is why Get/ReleasePrimitiveArrayCritical is slower.
No comments:
Post a Comment