← the Dry Stack

Nio

Zero-copy messaging. 16 µs round-trips, and hundreds of millions of messages a second on a handful of threads.

16 µs round-trip, median. gRPC takes 179 µs on the same machine. 206M messages a second across 64 connections, on 12 threads. 2.67 GiB/s bulk stream throughput. Raw sockets reach 2.34. 12 MB of thread memory at 1,000 connections. Thread-per-connection needs 2 GB.

Every figure here goes through the C# wrapper. The native core underneath is faster.

What it is
The network layer the rest of the stack rides on. Messages go from one buffer to the wire and back without copies: tens of millions a second on one connection, hundreds of millions fanned out.
The problem
Most systems pay a tax on every message: serialize, copy into the kernel, copy out, deserialize. Nio deletes the copies, so a round-trip takes microseconds instead of milliseconds.
For example
It carries replication in the failover demo, fast enough that the standby stays within one unsealed segment of the leader.
See it carry a cluster →

Same machine, same loopback, same 64-byte messages. Nio against the libraries you'd actually reach for.

LibraryRound-trip p50Push, 1 connBulk stream
Nio16 µs28M msg/s2.67 GiB/s
raw sockets52 µs28–40M msg/s2.34 GiB/s
NetCoreServer33 µs4.0M msg/s0.39 GiB/s
WebSockets67 µs75K msg/s0.86 GiB/s
gRPC179 µs49K msg/s0.15 GiB/s

Nio matches hand-rolled raw sockets on push, beats everything on latency and leaves gRPC and WebSockets 100 to 1000 times behind. Raw throughput isn't the headline, though. What it costs to scale is.

12 threads. 206M msg/s. Thread-per-connection needs 128 threads, a pair per connection, to push the same load. Nio drains all 64 connections with a few poll threads and no locks, doing 7 times the work per thread.
64 connectionsAggregateOS threadsPer thread
Nio206M msg/s1217M msg/s
raw thread-per-conn299M msg/s1282.3M msg/s

Thread-per-connection wins the drag race and loses the war. Here is the same test at 1,000 connections:

1,000 connectionsAggregateOS threadsThread memory1 s push took
Nio130M msg/s12~12 MB1.0 s
raw thread-per-conn307M msg/s2,000~2 GB7.2 s
Flat threads, flat memory. Nio runs a fixed pool of poll threads over pre-allocated, GC-free buffers, the same at 64 connections or 10,000. Thread-per-connection pays about 1 MB of stack per thread: at 1,000 connections that's 2,000 threads and 2 GB of stacks before a byte of payload, and the scheduler buckles. A one-second push took seven.

Test bed: AMD Ryzen 9 9950X (16 cores, 32 threads), 64 GB RAM, Windows 11 Pro, .NET 10 Release x64, loopback, through the C# wrapper. 64-byte messages; throughput is time-boxed, median of repeated runs. "Raw thread-per-conn" is one OS thread per socket per side, the plain blocking model. Full harness in samples/Nio.Benchmarks.

The example program in samples/Example runs seven tests over loopback: batched events, request/response, streaming both ways, mixed queries, broadcast and multi-client ping-pong.

TestLinuxRyzen 9 9950X, io_uringWindowsRyzen 9 7950X3D, RIO
Batched events, 10M messages99.2M msg/s30.0M msg/s
Request/response, average round-trip5.9 µs14.4 µs
Ping-pong, 10 clients, average round-trip6.4 µs14.1 µs

Linux runs about 2.5 to 3 times faster than Windows in this test. The 16 µs head-to-head figure above comes from a different harness and message size. The streaming and upload tests move under 1 MB, too little to measure bandwidth, so their numbers are only in the raw output.

show raw output ↓captured 20 June 2026, unedited
Want Nio in your system?

We're taking a few early users. If your messages spend more time in copies than in your code, tell us what you'd build. You get Nio and direct help; we get your feedback.

info@drylane.io
Nio is part of the Dry Stack, built by Drylane.