Head-to-head throughput, wire size, and field lookup measurements comparing OmniBuf against Protobuf, FlatBuffers, Cap'n Proto, MessagePack, and JSON.
Measured on an 11-field telemetry message with nested structs and arrays. Shorter bars = Faster / Smaller.
OmniBuf works directly on existing generated Go structs with zero codegen, or via the protoc-gen-omnibuf plugin for generated single-pass methods and lazy Opaque API
wire splicing.
| Operation | Protobuf | vtprotobuf | OmniBuf (No Plugin) | OmniBuf (Plugin) |
|---|---|---|---|---|
| Marshal | 561.4 ns (0 allocs) | 163.2 ns (0 allocs) | 201.8 ns (0 allocs) | 102.4 ns (0 allocs) |
| Unmarshal (Safe) | 959.9 ns (25 allocs) | 604.7 ns (24 allocs) | 735.0 ns (19 allocs) | 511.3 ns (17 allocs) |
| Unmarshal (Zero-Copy) | 959.9 ns (25 allocs) | 225.8 ns (0 allocs, Pool) | 309.0 ns (0 allocs) | 198.8 ns (0 allocs) |
| Read 2 Nested Fields | 992.0 ns (25 allocs) | 219.5 ns (0 allocs, Pool) | 309.0 ns (0 allocs) | 125.5 ns (0 allocs, Opaque) |
| Read-Modify-Write | 1,612.0 ns (25 allocs) | 359.7 ns (0 allocs, Pool) | 510.8 ns (0 allocs) | 143.5 ns (0 allocs, Splice) |
vtprotobuf with simpler generated code:
For schemas/peer.proto, vtprotobuf emits more than 2x as much generated code full of unrolled per-byte LEB128
loops, SizeVT() passes, and backwards buffer indexing. By contrast, protoc-gen-omnibuf emits under half the code (including all three Opaque* lazy readers with full scalar splice support) calling standard AppendVarint / DecodeVarint helpers, yet runs over 50% faster on Marshal and over 2x faster on
Read-Modify-Write because the wire format avoids 2-pass sizing and multi-branch varint
loops.
OmniBuf stays within a few bytes of Protobuf while encoding up to 6x faster, decoding up to 8x faster, supporting raw message concatenation, and making every wire type inspectable without a schema.
OmniBuf is 40% smaller on the wire, over 6x faster to encode, and faster on full message decodes while using standard .proto schemas instead of bottom-up builders.
On framed network packets, OmniBuf is 36% smaller, 12x faster to encode, and over 6x faster to decode without multi-segment pointer bounds checking.
OmniBuf is nearly half the size of MessagePack in shared-schema mode, and smaller even with Field #0 inline field names enabled while encoding over 6x faster.
OmniBuf is less than half the size of JSON and 17x to 32x faster, while still letting you use official ProtoJSON for human-readable debugging from the same .proto file.
just bench