Simplicity Scales
Bebop: A Branchless Data Interchange Format and RPC Protocol · 2026
Read Simplicity Scales by Bebop: A Branchless Data Interchange Format and RPC Protocol (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-09591.txt.
Introduction
Sampson, Saito, and Chan present Bebop, a serialization format in which every data type occupies a fixed number of bytes. Variable-length rivals force decoders to inspect each byte, stalling modern processor pipelines. With fixed sizes, decoding is a single memory read with no branches. Across 19 decode workloads, Bebop runs 9 to 213 times faster than Protocol Buffers. For a 1536-dimension embedding vector it decodes in 2.8 nanoseconds, against 111 for Protocol Buffers and under 5 microseconds for simdjson. A companion RPC protocol adds batch pipelining, letting dependent calls finish in one round trip.
Catalog record
| CREATOR | Bebop: A Branchless Data Interchange Format and RPC Protocol |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 53734 |
| LICENSE | http://creativecommons.org/licenses/by-sa/4.0/ |
| RIGHTS | CC BY SA |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2604.09591
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Simplicity Scales Bebop: A Branchless Data Interchange Format and RPC Protocol Abstract Abstract The dominant data interchange formats encode integers using a variable number of bytes or represent floating-point numbers as variable-length UTF-8 strings. The decoder must inspect each byte for a continuation bit or parse each character individually, producing data-dependent branches that stall modern CPU pipelines. Protocol Buffers pays this cost on every integer, field tag, and length prefix. JSON pays it on every value. We present Bebop, a serialization format where every data type uses a fixed number of bytes. A 32-bit integer is always four bytes. Decoding becomes a single memory read with no conditionals. Across 19 decode workloads, Bebop decodes 9–213 \times faster than Protocol Buffers. On a 1536-dimension embedding vector, Bebop decodes in 2.8 nanoseconds versus 111 nanoseconds for Protocol Buffers and 4.69 microseconds for simdjson, a 1,675 \times gap. On records above 64 KB, the decoder achieves 86% of peak memory bandwidth. The CPU is no longer the bottleneck. We also present a transport-agnostic RPC protocol built on the same wire format. The protocol introduces batch pipelining, where dependent cross-service calls execute in a single round trip with server-side dependency resolution. It deploys over HTTP/1.1, HTTP/2, and binary transports without proxies, removing the HTTP/2 requirement that limits gRPC on serverless platforms and in browsers. 1 Introduction Transport and storage bandwidth are scaling faster than the compute that sits between them. PCIe x16 throughput grew from 16 GB/s in 2010 to 121 GB/s in 2022 [ 13 ] . IEEE 802.3bs ratified 400 Gb/s Ethernet in 2017 [ 14 ] . Single-mode fiber has carried 402 Tb/s over 50 km in laboratory demonstration [ 16 ] . CXL 3.0 extends cache-coherent memory access across chassis boundaries [ 15 ] . Flash read bandwidth scales by ganging devices in parallel, and John Carmack has observed that pipelined flash arrays should already be viable for inference serving if accelerator vendors agreed on a high-speed interface [ 17 ] . These are different technologies on the same trajectory. Moving data is getting cheaper. Processor single-thread performance has not kept pace. Hennessy and Patterson measured the decline in their 2018 Turing Lecture [ 11 ] . Annual improvement ran at 52% during the RISC era, dropped to 22% after Dennard scaling broke down at the 90 nm node around 2004 [ 12 ] , and fell to roughly 3% by 2015. The gap between bandwidth growth and compute growth widens each generation. Serialization formats carry assumptions about which resource is scarce. Protocol Buffers shipped in 2008 [ 3 ] when 1 GbE was standard data center networking. Varint encoding trades CPU cycles for fewer bytes on the wire, a reasonable choice when bandwidth cost dominated. JSON requires character-by-character parsing but provides human readability, a tradeoff that made sense when most payloads were small API responses. Kenton Varda, who maintained Protocol Buffers at Google, noted that the original inventor’s own notes described varint as “a poorly-chosen format due to excessive branching” [ 2 ] . His later project Cap’n Proto [ 4 ] uses fixed-width encoding to avoid this overhead. The CPU cost was recognized early. The bandwidth context has changed since. Bebop uses fixed-width encoding for every data type. A 32-bit integer is always 4 bytes. Decoding reduces to a single memory read with no conditionals. In benchmarks across 19 decode workloads, Bebop decodes 9–213 \times faster than Protocol Buffers. On a 1536-dimension embedding vector, Bebop decodes in 2.8 nanoseconds; simdjson [ 10 ] , the fastest general-purpose JSON parser, takes 4.69 microseconds on equivalent data, a 1,675 \times gap. The decoder achieves 86% of peak memory bandwidth on records above 64 KB. At that point, the CPU has nothing left to stall on. LinkedIn found that switching from JSON to Protocol Buffers reduced P99 latency by 60% for large payloads [ 33 ] ; the gap between Protocol Buffers and Bebop is larger still. Fixed-width encoding costs more bytes for small integers. In Section 4 , OrderLarge with arrays of 100 small integers produces 1,240 bytes in Bebop versus 423 in Protocol Buffers. For workloads dominated by floats, embeddings, and timestamps, the wire size penalty is negligible. Compression narrows the gap further. With Brotli, all three formats produce ML payloads within 2% of each other. The decode performance difference persists regardless of compression. 1.1 Contributions This paper makes the following contributions: 1. A wire format specification optimized for decode throughput rather than wire compactness 2. Empirical comparison against Protocol Buffers, MessagePack, and simdjson across 19 decode and 23 encode workloads representing ML inference, event streaming, and recursive data structures 3. A schema language with compile-time extensibility through embedded Lua scripting 4. Reference implementations in C achieving 86% memory bandwidth utilization during decode 5. An RPC protocol with batch pipelining for dependent cross-service calls, reducing round trips without requiring application-level coordination 2 Design Principles 2.1 Fixed-Width Encoding Every numeric type in Bebop has a fixed wire size. A uint32 is always 4 bytes. A float64 is always 8 bytes. Length prefixes are always 4 bytes. The decode operation for a 32-bit integer reduces to a single load instruction: ⬇ // Bebop decode: one load, no branches uint32_t value = *( uint32_t *) input ; input += 4; In comparison, Protocol Buffers varint decode loops until finding a byte without the continuation bit set: ⬇ // Protobuf varint decode: branch per byte uint32_t value = 0, shift = 0; while (* input & 0 x80 ) { value |= (* input ++ & 0 x7f ) << shift ; shift += 7; } value |= * input ++ << shift ; This varint loop during decode has unpredictable iteration count when integer values vary, causing branch misprediction penalties on modern CPUs. 2.1.1 Expected Encoding Size For an unsigned 32-bit integer v>0 , varint encoding uses \lceil(\lfloor\log_{2}v\rfloor+1)/7\rceil bytes. The value v=0 uses 1 byte. Fixed-width encoding always uses 4 bytes. This analysis covers only non-negative integers; signed integers have a pathological case where negative values always use maximum bytes (see Section 2.1.3). For unsigned integers uniformly distributed over [0,N] , we can compute the expected varint size by counting how many values fall into each byte-width bucket. Values in [0,2^{7}-1] use 1 byte, values in [2^{7},2^{14}-1] use 2 bytes, and so on: E[\text{varint}]=\frac{1}{N+1}\sum_{k=1}^{5}k\cdot\bigl|\{v\in[0,N]:2^{7(k-1)}\leq v<2^{7k}\}\bigr| (1) where the k=1 bucket includes v=0 . Figure 1 shows this tradeoff. The left axis shows wire size: varint uses fewer bytes for small values, crossing over at N>2^{28} . The right axis shows decode latency: fixed-width decoding is constant (one load instruction), while varint decoding increases with byte count due to per-byte branching. For ML workloads with large values, fixed-width encoding is both smaller and faster. 2^{0} 2^{7} 2^{14} 2^{21} 2^{28} 2^{32} 1 2 3 4 5 crossover Maximum value N Wire size (bytes per integer) Fixed-width size Varint size 2 4 6 8 10 Decode latency (relative) Fixed-width decode Varint decode Figure 1: Wire size (solid lines, left axis) vs decode latency (dashed lines, right axis). Varint is smaller for small, positive values but always slower to decode. Above 2^{28} , fixed-width wins on both metrics. Real-world integer distributions are rarely uniform. Zipfian distributions