redb icon indicating copy to clipboard operation
redb copied to clipboard

Add async read interface

Open cberner opened this issue 2 years ago • 16 comments

Blocked on:

  • [ ] https://github.com/tokio-rs/tokio/issues/1529

cberner avatar Jul 09 '21 04:07 cberner

It seems like read() even via IO uring is a lot slower than mmap, so I'm going to close this as won't fix.

Here are IO uring benchmarks: https://github.com/cberner/redb/pull/61

cberner avatar Aug 15 '21 04:08 cberner

👋 Thanks for sharing your code!

So async support is one of the first things I look for when new persistent trees pop up in the Rust ecosystem and I'm a bit saddened by finding this issue as wontfix.

Now I/O uring as an I/O interface is rarely going to be "as fast" as using mmap and letting the kernel synchronize memory regions directly with no buffer management and little to no syscall overhead. But async support would be valuable in itself in that it would allow redb to cleanly integrate with the rest of the async ecosystem.

As it stands when integrating redb into a larger async application you'd run the hazard of spurious I/O blocking due to page faults, forcing you to utilize coping mechanisms like a blocking thread pool which comes with its own overhead.

Integrating async I/O uring support comes with its own challenges that I'm sympathetic towards. But I'm at least curious if you could be convinced to reconsider the status of this issue?

udoprog avatar Apr 24 '22 01:04 udoprog

For sure, hope you or someone else finds it useful!

Ya, I think that's a good argument for reconsidering an async read interface. I'll take another look into this.

cberner avatar Apr 24 '22 01:04 cberner