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 | 562.6 ns (0 allocs) | 127.7 ns (0 allocs) | 200.3 ns (0 allocs) | 99.1 ns (0 allocs) |
| Unmarshal (Safe) | 976.4 ns (25 allocs) | 555.5 ns (24 allocs) | 778.1 ns (19 allocs) | 494.4 ns (17 allocs) |
| Unmarshal (Zero-Copy) | 976.4 ns (25 allocs) | 201.3 ns (0 allocs, Pool) | 303.7 ns (0 allocs) | 198.3 ns (0 allocs) |
| Read 2 Nested Fields | 978.0 ns (25 allocs) | 202.0 ns (0 allocs, Pool) | 303.7 ns (0 allocs) | 128.1 ns (0 allocs, Opaque) |
| Read-Modify-Write | 1,550.0 ns (25 allocs) | 332.2 ns (0 allocs, Pool) | 504.0 ns (0 allocs) | 153.5 ns (0 allocs, Splice) |
vtprotobuf with simpler generated code:
For schemas/peer.proto, vtprotobuf emits 1,899 lines of unrolled per-byte LEB128 loops, SizeVT() passes, and backwards buffer indexing. By contrast, protoc-gen-omnibuf emits just 781 lines (including all three Opaque* lazy readers with full scalar splice support) that call standard AppendVarint / DecodeVarint helpers, yet runs 1.29x faster on Marshal and 2.16x 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