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.

Nanoseconds per message, lower is better.
SyrupCap'n Proto
65 75 encode 53 81 decode
SyrupCap'n Proto
encode ns64.675.1
decode ns52.980.6
encode MB/s1,0843,514
decode MB/s1,3233,274
frame bytes70264

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.

Protocol-core bytes per connection, inline state plus heap, lower is better.
1,080 idle 1,840 warmed 2,344 active16 2,935 served
connection statebytes / connectionat 500k connections
idle1,0800.5 GiB
warmed1,8400.86 GiB
active162,3441.09 GiB
served2,9351.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.

metricvalue
Allocations per delivered turn1 (build check requires == 1)
Frame-view projections exercised1,000,000
Argument / Message struct bytes40 / 104
Reference / Resolution struct bytes24 / 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.

TCP (cleartext baseline)iroh (encrypted QUIC)
Round-trip latency (µs, lower is better).
13.1 48.3 p50 14.4 138.4 p99
Throughput (round trips a second, higher is better).
76,341 20,058 round-trips / s
iroh round trips a second, one stream against 16 connections on one thread, higher is better.
20,058 one stream 92,531 16 connections

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.

transportp50 µsp99 µsround trips / s
TCP (cleartext)13.114.476,341
iroh, one stream48.3138.420,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.

language clientGoblins reference (CapTP peer)
Latency (p50 ms/unit, lower is better).
0.05 zig 0.07 rust 0.11 deno 0.19 python 0.18 racket 0.59 goblins-ref
Throughput (task-board units/s, higher is better).
56,713 zig 46,560 rust 18,379 deno 11,656 python 7,986 racket 2,101 goblins-ref
Cold start (ms from spawn through one completed task-board unit, lower is better).
0.7 zig 1.5 rust 69 deno 54.5 python 296.1 racket 361.6 goblins-ref

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.

clientruntimep50 (ms/unit)units/ssetup (ms/conn)mem (kB/conn)cold (ms)
zigzig0.0556,7130.340757.30.7
rustrust0.0746,5601.355384.61.5
denodeno0.1118,3791.4138193.669
pythoncpython0.1911,6561.363599.254.5
racketracket-cs0.187,9861.311274.5296.1
goblins-refracket-cs/goblins0.592,1012.984830.5361.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.

Call latency (p50 µs by conversation count).
awakeasleep
0.7 2 64 0.7 2.1 512 0.7 2.2 2,048
Memory (MiB by conversation count, all actors asleep).
records on diskZig heap
1 0.1 64 8.4 0.4 512 33.6 1.5 2,048
conversationsawake call p50 µsasleep call p50 / p99 µsedit p50 / p99 msrestart to first call msrecords read at restart
640.72 / 2.12.6 / 4.231
5120.72.1 / 2.22.4 / 3.91.91
2,0480.72.2 / 2.32.5 / 4.321

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 sessionsserver baseline KiBserver loaded KiBserver delta KiB/sessionload process KiBbarrier seconds
1,00011,76430,20818.4425,9320.077
10,00011,916132,84012.09103,3240.427
50,00011,860458,8688.94326,4401.287
100,00011,860865,2968.53602,9922.31
500,00011,8764,176,0608.332,809,31616.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.

transportopen p50 µsopen p99 µsopen mean µs
tcp319.71425.57326.7
noise-tcp828.07919.2835.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.