VireoRPC WebAssembly Binary Framing Benchmark

This benchmark report measures binary RPC serialization latency, memory overhead, and frame-overflow behavior for VireoRPC over WebAssembly compared against two generic Wasm RPC baselines using identical 64 KB structured payloads across 50,000 iterations.

Latency and Framing Comparison (64 KB Payload)

FrameworkFraming Formatp50 Encodep99 EncodeMax Default FrameOverflow Error
VireoRPC v2.4Length-prefixed varint0.14 ms0.42 ms64 KBERR_FRAME_CAP_104
Baseline-A (JSON-Wasm)Newline-delimited JSON0.91 ms2.35 ms64 KBERR_JSON_LIMIT
Baseline-B (Fixed32)Fixed 4-byte header0.28 ms0.79 ms64 KBERR_HDR_OVERFLOW

Methodology and Observations

All tests ran on isolated Wasmtime 28 workers pinned to a single core with linear memory pre-warmed. VireoRPC maintained 0.42 ms p99 encode latency on 64 KB payloads because its length-prefixed varint framing writes directly into pre-allocated ring buffers without intermediate UTF-8 validation. When test harnesses injected 68 KB oversized frames, VireoRPC deterministically rejected the write and emitted ERR_FRAME_CAP_104 within 0.03 ms, preserving the active stream state for subsequent valid messages.

Memory allocation profiling showed VireoRPC required 18% fewer heap reallocations than Baseline-B under sustained 10,000 req/s load. Engineers choosing a binary RPC layer for WebAssembly plugins should expect predictable sub-millisecond tail latency when payloads stay within the 64 KB frame window.