Calling Native Methods Without JNI Overhead
summary
The talk explains approaches to calling native (non-Java) code from Java—covering JNI, JNA, JNR-FFI and Project Panama—and focuses on the overheads these interfaces introduce. It presents a replacement for removed HotSpot Critical Natives: a library that uses JVMCI (the JVM Compiler Interface) to enable faster external function calls, describes the approach’s limitations, and compares its performance to the alternatives.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 2:37Native method calls problem
- 8:05Java vs JNI speed
- 11:16High overhead causes
- 19:08JDK 20 barrier optimizations
- 21:02Native method usage examples
- 27:13Intrinsics issues
- 33:53Panama limitations
- 34:15Machine code generation
- 41:47Nalim library for JMC
- 43:54Performance results
- 46:44Limitations and licensing
related talks
36mA Promising Future for using Native Libraries in the Java World
01h 04mProject Panama Unleashing Native Libraries
29mEasily Leverage Native Functions with Project Panama from Java
41mJNI, czyli Java i C w jednym projekcie
01h 01mNative Code, Off-Heap Data and Java
47mInterconnecting Java and Native Code with the FFM API
01h 09mFrom Bytecode to Native Code in HotSpot JVM
16mForeign Function and Memory API
