r/java • u/DavidVlx • 5d ago
JUring - async file I/O for Java (Part 2)
Hi everyone!
I have been working on and off on IO_Uring bindings for Java. It's been two years already since the last update. It has changed a lot since then, and it became a lot quicker as well! Dropped Liburing for directly mapping the rings into memory and no more allocations on the hot path.
It still has two public API's one mimics Liburing in a way and handles everything for you, the other is the nice one that support Virtual threads and unmounts them on file I/O.
You can find the project here if you are interested :-) https://github.com/davidtos/JUring
I wanted to share it, because there doesn't seem to be a whole lot of FFM code out there (on the performance side). I Think the most interesting part besides the actual ring mangement, are the Bitpacker and "Global memory view". There are JMH and jcstress in there as well, which were a separate challenge to write.
It is still a work in progress, and I'm still learning new things every day. Would love to hear your thoughts, feedback, or critiques if you've worked on or used something similar. Happy to answer any questions about the implementation!