v0.15.0
-
Overhaul of the
epollandkqueuebackends, to make them comparable to the performance of
the io_uring backend. When migrating from libxev to our own event loop, I decided to use
a similar approach for both backends, which really goes against the nature of these APIs.
With this new rewrite, both backends keep fds registered in the kernel, so readiness is
always available. This results in far fewer syscalls, and overall better performance.
One side effect is that now tasks that were running on executor A can be moved to
executor B, if the event loop B is where the fd is registered. -
Improved performance of
net.Stream.Writer.sendFileon all platforms. There is now
a native zero-copy implementation for Windows usingTransmitFile, and the generic
fallback now uses the entire reader/writer buffers, so it's always faster than the
read/write loop fallback implemented instd.Io.Writer. -
Added
File.stdReader/File.stdWriterto wrap a zio-opened file as the concrete
std.Io.File.Reader/std.Io.File.Writertypes, so it works withstd.IoAPIs that
require them (likestd.Io.Writer.sendFileAll). -
Implemented wall-clock timers, so you can now sleep/timeout using the real-time clock and be
woken up exactly on time, even if the clock is adjusted. This is natively supported on Linux,
but needs more careful coordination on other platforms. -
Added support for all clocks that
std.Iosupports (real,boot,awake, and the
cpu_process/cpu_threadCPU-time clocks), as well as querying their resolution. -
Changed how
stdin/stdout/stderrare handled on Windows, to make sure we can work
with these without blocking the event loop, since they are not open asOVERLAPPEDhandles. -
Changed the
io_uringbackend from futex-based wake ups toeventfd, which works much
more reliably. The previous futex approach introduced wake up latency that I could not explain. -
Error code
ETIMEDOUTis now mapped toerror.ConnectionTimedOutfor send/recv operations.
We are not using kernel-level socket timeouts, but it seems that these error codes can still happen. -
New
TaskLocalAPI for storing custom task-local data. -
Added custom
randomandrandomSecureAPIs for generating random numbers,
to reduce dependency onstd.Io.Threaded. -
Fixed handling of Unix socket addresses containing null bytes.
-
Fixed race in cross-thread handling of
AcceptExcalls on Windows. -
Fixed shutdown sequence to properly stop the thread pool before closing the event loop.
-
Fixed memory leak that happens after spawning blocking tasks on the thread pool.