denoland / deno

A modern runtime for JavaScript and TypeScript.

Home Page:https://deno.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Investigate `IO_URING` support

espoal opened this issue · comments

I'm opening this issue to investigate the opportunity of implementing IO_URING in Deno. If you haven't heard about it IO_URING is a new revolutionary API for doing asynchronous operations in Linux with a much higher throughput, much lower tail latencies and CPU usage.

While investigating how to implement IO_URING for node, I came up with an approach which I think can make this very simple: Instead of implementing directly liburing via NAPI, I used a thin layer to expose syscalls to a WASM module, to then do the heavy lifting in WASM. More details here

This not only greatly simplify the approach, but maximize reusability across WASM compatible runtimes. Also I think this kind of taks is a perfect fit for Rust, with its safety guarantees and speed.

Unfortunately I don't know much about Deno internals, but here maybe the Node and Deno community could come together to write a common WASM module?

Bun has io_uring support.

Rust ecosystem has both low-level and high-level io_uring support.

It may be easier to start with high-level APIs.

Nice. I created an awesome-iouring repo to keep track of all existing io_uring implementations and resources. Please contribute if you know about anything I'm missing.

About tokio-uring: unfortunately it doesn't support some of the nice new things io_uring implemented, like IORING_OP_URING_CMD, registering buffers or IORING_SETUP_SQPOLL (for the last two I can see them in the code but they don't seem to be used anywhere)

I feel my approach could be simpler and easier to update: my implementation is only 400 lines of code, it's easier to port and it supports already all the nice features