swift-nio
swift-nio copied to clipboard
Linux: full io_uring I/O
With @hassila's fantastic work in #1804 (and beyond), the path for SwiftNIO on io_uring has begun. To fully leverage all the potential benefits, we should at some point offer SwiftNIO doing I/O through io_uring (with #1804 we're doing "uring lite" which uses io_uring only for eventing but the regular syscalls for the actual I/O).
For inspiration, there is of course netty-incubator-transport-io_uring
.
To facilitate development (and maybe also spike out #1829) we could start this off in a separate repository which would mean we can break API more easily and aren't bound to NIO's pretty vast Swift version compatibilities. This will very likely require new Channel
and EventLoop
types anyway so a separate repository may not be too bad. The biggest concern is probably the inability to reach NIO
internals for which we should come up with a story (maybe via @_spi
)
CC @Lukasa / @hassila sorry, just a quick blurb here to have a place to discuss when the time comes.
Also related to what we discussed in https://github.com/apple/swift-nio/issues/1805.
The initial POC of how it can be done is here https://github.com/apple/swift-nio/pull/2357 Can discuss it in the PR.
An update of state of io_uring & networking from Jens Axboe:
https://kernel.dk/io_uring%20and%20networking%20in%202023.pdf