4 ms·
JNI is expensive, but the JDK implementers give themselves some much more efficient ways to call into native code that aren't available to us mere mortals. For
by twic 6y ago
JNI is expensive, but the JDK implementers give themselves some much more efficient ways to call into native code that aren't available to us mere mortals. For example, "HotSpot intrinsics", which are mostly used to hook into JVM internals, but also for some performance critical stuff:
https://gist.github.com/apangin/7a9b7062a4bd0cd41fcc https://gist.github.com/apangin/7a9b7062a4bd0cd41fcc
Ordinary native methods implemented by the JVM itself don't need to use JNI either.