bitsery icon indicating copy to clipboard operation
bitsery copied to clipboard

io_uring based stream adapter

Open victorstewart opened this issue 4 years ago • 5 comments

not sure if you've heard about io_uring on Linux but it basically allows for syscall-less asynchronous operations and IO through the kernel. It's incredibly fast. I can show you a generic read/write file object i wrote to do DirectIO.

anyway this would obviously be the most performant way to stream to/from disk.

not sure how you'd feel about including a new stream adapter into the library that had a dependency on https://github.com/axboe/liburing + Linux.

even if not in the library, i assume if I wrote a new BasicBufferedOutputStreamAdapter say IOuringBufferedOutputStreamAdapter, and the same for input, and mimicked all the function calls etc, that it would "just work"?

I have a situation where I'm serializing very large (possible into the GBs) objects then writing them to disk, and don't want to blow up memory, thrash the page cache (hence DirectIO), nor waste precious seconds getting the data onto disk.

victorstewart avatar Dec 17 '20 21:12 victorstewart

I wouldn't want to include any additional dependency. However, it would be super cool to have separate bitsery_uiring library using modern cmake and I would include a link in the readme to it, and everyone would be happy:) If you don't mind I would like to create it, and make you collaborator (meaning you would have write access to it). What do you say?:)

fraillt avatar Dec 18 '20 20:12 fraillt

sure let's do it 🖖🏿

victorstewart avatar Dec 19 '20 10:12 victorstewart

I will create a repo and will provide a cmake setup so you could start working on implementation

fraillt avatar Dec 20 '20 13:12 fraillt

@victorstewart Are you still interested in this? I want to remind you, that I have created a repository to get started in here.

fraillt avatar May 28 '21 11:05 fraillt

sorry yes, unfortunately right now i'm buried in a bunch of work for a while so i don't know when i could commit to writing it just now.

victorstewart avatar May 30 '21 01:05 victorstewart