-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
Description
#14962 has introduced a safe method (using NIO ByteBuffer) to interact with io_uring queues, but as usual, this doesn't come for free: it would be good to verify that performance is not impacted and/or mitigate it, in case.
The completion's queue array decoding seems to read way less fields, but should require the same analysis.
This work has been motivated by https://github.com/openjdk/loom/blob/c25b25646e23bccd04265ee5aaa907d0945f323d/src/java.base/linux/classes/jdk/internal/ffi/generated/iouring/io_uring_sqe.java and https://github.com/openjdk/loom/blob/c25b25646e23bccd04265ee5aaa907d0945f323d/src/java.base/linux/classes/sun/nio/ch/iouring/IOUring.java#L570-L609 which:
- uses sliced
MemorySegment
s - zeoed
The last one is something I'm happy we don't do, but fixed offset accesses on trusted memory segment (i.e. with base offset, memory address and endiannes constant) could give some performance advantage over NIO ByteBuffer
,
In #15486 we've evaluated that VarHandle
s byte buffer view to be very performant, but we lack to verify how it fear compared to MemorySegment
in this scenario (indexed accesses) - and if it matters, in the grand scheme.