I'm developing JNI implementation similar to sun.misc.Unsafe but with extended memory management.
How to explain that call time of native methods from sun.misc.Unsafe and from my developed library is extremely different?
Some numbers: sun.misc.Unsafe.getInt(address) takes ~1ns when my similar method takes ~10ns
Both implementations are quite the same, following source code of openJDK, just return variable by pointer. Unsafe in JNI module, registered in the same manner as other.
How to speed up JNI call? What makes Unsafe so special for performance?
Thanks, Yury/