State of native access in Apache Lucene
summary
Lucene 10 adopts Java 21 and uses Project Panama to get true off-heap access via MemorySegment and fast foreign calls; the memory-mapped directory now issues madvise/fadvise hints and can preload pages, which reduces page faults and enables vectorized math (previously 4x speedups). Implementation works but is fragile: Panama APIs are preview so public APIs cannot expose them, build-time signature extraction avoids the preview classfile flag, fadvise on NIO lacks a file-handle API, and recent Linux kernels’ reclaim behavior causes unexpected swapping.
AI-written summary · about
chapters (9)
- 0:00Introduction and history
- 2:31Evolution of Lucene
- 5:29Project Panama overview
- 10:45Solving the preview dilemma
- 19:19Native access implementation
- 28:40Ongoing work and IO constraints
- 32:10GPU integration challenges
- 33:23Development model and future
- 38:00Q&A and closing
related talks
45mProject Panama - Foreign Function & Memory API
01h 04mProject Panama Unleashing Native Libraries
41mApache Lucene and Java 9+ #bbuzz
29mEasily Leverage Native Functions with Project Panama from Java
46mBare Metal Java
43mPanama Update
36mA Promising Future for using Native Libraries in the Java World
01h 01mNative Code, Off-Heap Data and Java
