Bid requests are compressed because bytes between data centers cost money. Once the bidder runs inside the exchange, that reason is gone, and the message format becomes a choice with real trade-offs.
I already tested one such format, FlatBuffers, on real traffic, and checking a request became more than ten times cheaper than decoding it with protobuf. A bidder says no to most requests it gets, so a cheaper no lets the same servers look at more of the exchange’s supply.
This time I compared four of them: FlatBuffers (Google), Cap’n Proto, SBE (a standard from trading systems) and Karmem (a small Go project). All four let the bidder read a field straight from the received bytes, and both sides must share the same schema. They differ in three things: how a field is found inside the bytes, how much the reader checks before it trusts them, and how much work the exchange does to build the message. I ran all four on the same 20,000 real requests from our traffic, with the checks of the four line items that bid in that sample, and every format picked the same bids, so they differ only in cost and safety.
FlatBuffers puts a small table of positions at the start of every object, so the bidder looks up where a field is and reads it, in any order.
Cap’n Proto connects objects with pointers and checks each pointer before it follows it, so it is designed to return an error on a broken message instead of crashing.
SBE keeps numbers at fixed places but writes text and lists one after another, so the order of reading matters: a late field like the country is reached only by stepping over everything before it, and SBE is fastest when the bidder reads fields in the order they were written.
Karmem lays out the bytes so a Go struct fits directly on top of them, which makes reading almost free, but it writes every nested object, even an empty one.
Counting both sides, the exchange that builds the message and the bidder that checks it (and reads in full the one request in a hundred we bid on), protobuf costs 5.3 µs per request. SBE and Karmem cut that by about 75%, and SBE by about 80% when the bidder reads in layout order. FlatBuffers cuts it by about half, because its builder is slow, and Cap’n Proto by only 15%, because it pays for its pointers on both sides. At a million requests per second, SBE or Karmem saves about four CPU cores. The gains are real, but only if the exchange and the bidder both switch.
Inside the exchange’s cluster both sides want the trade to happen, so the bidder can trust the bytes it gets, and Cap’n Proto’s checks matter less. That points to SBE or Karmem: SBE needs both sides to agree on the order of fields, and Karmem has had no updates since 2023, though results like these may be a reason to bring it back. The format also changes how much work the garbage collector has, and that deserves its own post.
Thanks to Brian Tomasette, whose question about Cap’n Proto gave me the idea for this experiment!




