Performance
These charts report throughput, latency, and memory use on one machine. Each dated snapshot names its source and environment. Beside other systems compares the same calls in Cap’n Proto RPC and Spritely Goblins.
Benchmark snapshot of source v0.1.6-62-g19c1286a2 on 2026-11-15: Linux aarch64, 20 logical CPUs, 122 GiB RAM, Racket v9.3 CS, Spritely Goblins v0.18.0-52-gdcc2b2c5, and the glowcap archives built by Zig 0.17.1 in ReleaseFast. zig build bench-site-report repeats it.
Build checks hold selected allocation, copy, and core-state size budgets. zig build check fails when those budgets change. zig build perf-check catches coarse timing regressions. The milestones to 1.0 name the constants and tests behind the budgets.
Codec throughput
bench-codec encodes and decodes the same small method call with Syrup and Cap’n Proto. Compare nanoseconds per message, because MB/s also reflects that Cap’n Proto emits a larger frame. The chart shows the small call. The bench also decodes the larger seventy-six value report call into borrowed views of the frame, where the Cap’n Proto codec reads each value in place. Codecs covers the choice.
| Syrup | Cap'n Proto | |
|---|---|---|
| encode ns | 64.6 | 75.1 |
| decode ns | 52.9 | 80.6 |
| encode MB/s | 1,084 | 3,514 |
| decode MB/s | 1,323 | 3,274 |
| frame bytes | 70 | 264 |
The protocol engine alone, with no sockets, handles 10,101,824 inbound messages a second, and adds an entry to a sparse import table in 46.9 ns.
Per-connection footprint
bench-peer-scaling counts inline and heap memory in each state: idle (accepted, awaiting its first message), warmed (one export and one delivered message), sixteen live exports, and served with a vat. The half-million column is arithmetic over core memory, not RSS or a live network test.
| connection state | bytes / connection | at 500k connections |
|---|---|---|
| idle | 1,080 | 0.5 GiB |
| warmed | 1,840 | 0.86 GiB |
| active16 | 2,344 | 1.09 GiB |
| served | 2,935 | 1.37 GiB |
Frame ownership and dispatch
bench-frame-view shows that steady delivery makes one allocation per message, for the frame it owns. It also reads frames through FrameView, a borrowed view that owns nothing, and records the sizes of the message structs.
| metric | value |
|---|---|
| Allocations per delivered turn | 1 (build check requires == 1) |
| Frame-view projections exercised | 1,000,000 |
| Argument / Message struct bytes | 40 / 104 |
| Reference / Resolution struct bytes | 24 / 48 |
Encrypted transport round-trip
bench-transports times one full OCapN greet round-trip on loopback over iroh’s keyed QUIC and over cleartext TCP as a baseline.
The first two charts keep one call in flight. iroh’s QUIC library is Rust and runs on its own runtime, so each serial call pays a cross-thread wake that the benchmark does not separate from encryption. The third chart runs many iroh connections on one thread. Loopback removes propagation delay and packet loss, so none of these values is field latency. The TCP row pins the client and the server to a core each, and is the same measurement as the second group beside Cap’n Proto RPC. The iroh rows pin no thread to a core, because iroh’s runtime places its own.
Both bars are iroh. One stream keeps one call in flight. Beside it, 16 connections share one thread, the way a server carries many peers at once.
| transport | p50 µs | p99 µs | round trips / s |
|---|---|---|---|
| TCP (cleartext) | 13.1 | 14.4 | 76,341 |
| iroh, one stream | 48.3 | 138.4 | 20,058 |
| iroh, 16 connections on one thread | — | — | 92,531 |
Cost through each language binding
bench-langs keeps one glowcap server, written in Zig, fixed while the client changes. Method details are in the bench README.
One unit creates, assigns, completes, and checks a task. Latency awaits each call in sequence. Throughput pipelines the calls and awaits the final status.
Each row is a whole consumer stack (runtime, binding, the app rewritten in that language, and its garbage collector) over one Zig host. Read it as consumer cost. The Goblins row is the reference CapTP implementation dialing in.
| client | runtime | p50 (ms/unit) | units/s | setup (ms/conn) | mem (kB/conn) | cold (ms) |
|---|---|---|---|---|---|---|
| zig | zig | 0.05 | 56,713 | 0.3407 | 57.3 | 0.7 |
| rust | rust | 0.07 | 46,560 | 1.3553 | 84.6 | 1.5 |
| deno | deno | 0.11 | 18,379 | 1.4138 | 193.6 | 69 |
| python | cpython | 0.19 | 11,656 | 1.3635 | 99.2 | 54.5 |
| racket | racket-cs | 0.18 | 7,986 | 1.3112 | 74.5 | 296.1 |
| goblins-ref | racket-cs/goblins | 0.59 | 2,101 | 2.9848 | 30.5 | 361.6 |
Persistent actors in Loam
Loam keeps actors in a database and loads one only when a call reaches it. bench-loam builds a graph of conversations in LMDB (a memory-mapped key-value database) and grows it from 64 to 2,048. The workload notes describe each phase.
| conversations | awake call p50 µs | asleep call p50 / p99 µs | edit p50 / p99 ms | restart to first call ms | records read at restart |
|---|---|---|---|---|---|
| 64 | 0.7 | 2 / 2.1 | 2.6 / 4.2 | 3 | 1 |
| 512 | 0.7 | 2.1 / 2.2 | 2.4 / 3.9 | 1.9 | 1 |
| 2,048 | 0.7 | 2.2 / 2.3 | 2.5 / 4.3 | 2 | 1 |
Each conversation is one callable actor and four 4,096-byte messages in LMDB with synchronous commits. An asleep call loads the actor's record first. An edit is one call and one durable commit. A restart opens the database in a new Host and answers one call, reading only the record it calls. At 2,048 conversations the Zig heap holds 0.7 KiB per conversation, against 16.8 KiB of records on disk. The heap excludes LMDB's mapped pages, which the operating system caches separately.
Live sessions
The capacity run keeps real sessions open while measuring memory. Separate runs time session opening. These include the driver and sockets, beyond the core-state sizes in Per-connection footprint.
Benchmark snapshot of source v0.1.6-62-g19c1286a2 on 2026-11-15: Linux aarch64, 20 logical CPUs, 122 GiB RAM, Racket v9.3 CS, Spritely Goblins v0.18.0-52-gdcc2b2c5, and the glowcap archives built by Zig 0.17.1 in ReleaseFast. zig build bench-site-report repeats it.
Cleartext loopback TCP with signed CapTP handshakes and a bootstrap fetch on every connection. All sessions remain open at the RSS sample. The server uses 32 HostRuntime shards. A separate raw-peer process supplies load. The run uses an isolated Linux user/network namespace and a descriptor limit of 524288. Linux chooses io_uring or epoll at runtime. RSS excludes kernel socket memory. These are capacity and barrier measurements, not WAN latency or sealed-channel capacity.
| live sessions | server baseline KiB | server loaded KiB | server delta KiB/session | load process KiB | barrier seconds |
|---|---|---|---|---|---|
| 1,000 | 11,764 | 30,208 | 18.44 | 25,932 | 0.077 |
| 10,000 | 11,916 | 132,840 | 12.09 | 103,324 | 0.427 |
| 50,000 | 11,860 | 458,868 | 8.94 | 326,440 | 1.287 |
| 100,000 | 11,860 | 865,296 | 8.53 | 602,992 | 2.31 |
| 500,000 | 11,876 | 4,176,060 | 8.33 | 2,809,316 | 16.505 |
Session opening includes connect, handshake, bootstrap fetch, and close. Each transport runs separately, with the client and the server each pinned to a core. The table reports measured latency, without treating signing and handshake primitives as a complete cost model.
| transport | open p50 µs | open p99 µs | open mean µs |
|---|---|---|---|
| tcp | 319.71 | 425.57 | 326.7 |
| noise-tcp | 828.07 | 919.2 | 835.16 |
Repeat the measurements
zig build bench-site-report refreshes the charts from live ReleaseFast runs. To run one bench, use its name from the section above and add -Doptimize=fast. On a machine with a cluster of faster cores the report keeps every bench but the live-session run on that cluster, so a bench run by name there can draw a slower core and report a higher figure.
The benchmarks README also covers primitive costs such as signing, Noise handshakes, and frame copies, along with calls whose runtimes spin instead of sleeping.