Benchmarks &
Format Comparisons.

Head-to-head throughput, wire size, and field lookup measurements comparing OmniBuf against Protobuf, FlatBuffers, Cap'n Proto, MessagePack, and JSON.

Benchmarks.

Measured on an 11-field telemetry message with nested structs and arrays. Shorter bars = Faster / Smaller.

Full Message Encode Speed
OmniBuf
94 ns
Protobuf
561 ns
FlatBuffers
562 ns
Cap'n Proto
1016 ns
MessagePack
1552 ns
JSON
1720 ns
Full Message Decode Speed
OmniBuf
120 ns
FlatBuffers
170 ns
Cap'n Proto
772 ns
Protobuf
960 ns
MessagePack
2496 ns
JSON
3850 ns
Read a Single Nested Field (peer.location.city)
Cap'n Proto (Unframed Shared Memory)
5 ns
FlatBuffers
13 ns
OmniBuf
76 ns
Cap'n Proto (Framed Packet)
221 ns
MessagePack
590 ns
Protobuf
983 ns
Packet Size on the Wire
Protobuf
341 B
OmniBuf
362 B
Cap'n Proto
560 B
FlatBuffers
600 B
OmniBuf (With Field #0 Names)
622 B
MessagePack
656 B
JSON
803 B

Integration Tiers & Opaque Splicing.

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.

Protobuf vs. vtprotobuf vs. OmniBuf
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)
Why OmniBuf beats 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.

How OmniBuf compares to other formats.

OmniBuf vs. Protobuf
OmniBuf Protobuf
WIRE SIZE ENCODE SPEED DECODE & SKIP MEMORY EFFICIENCY SIMPLICITY

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.

Why Choose OmniBuf Over Protobuf
  • ✓ Over 2x to 6x faster encoding with single-pass writes instead of measuring nested objects twice.
  • ✓ Over 2x to 8x faster full decoding with branchless Prefix-Varints.
  • ✓ Self-describing 4-bit wire types and optional Field #0 names eliminate Wire Type 2 ambiguity.
  • ✓ Faster field skipping while preserving raw message concatenation (append(msgA, msgB...)).
When Protobuf Wins
  • → Built into existing Protobuf ecosystems and third-party services where you cannot change the wire format.
  • → Roughly 6% smaller wire payloads because Protobuf uses 3-bit tags and 1-byte lengths on small nested messages.
OmniBuf vs. FlatBuffers
OmniBuf FlatBuffers
WIRE SIZE ENCODE SPEED DECODE & SKIP MEMORY EFFICIENCY SIMPLICITY

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.

Why Choose OmniBuf Over FlatBuffers
  • ✓ 40% smaller packets on the wire because there are no VTables or alignment padding.
  • ✓ Over 6x faster encoding with normal top-down writes instead of bottom-up builders.
  • ✓ Faster full message decoding and supports raw byte concatenation.
  • ✓ Works directly with standard .proto schemas.
When FlatBuffers Wins
  • → Faster single-field random access when reading one field out of a very large message via VTable offsets.
OmniBuf vs. Cap'n Proto
OmniBuf Cap'n Proto
WIRE SIZE ENCODE SPEED DECODE & SKIP MEMORY EFFICIENCY SIMPLICITY

On framed network packets, OmniBuf is 36% smaller, 12x faster to encode, and over 6x faster to decode without multi-segment pointer bounds checking.

Why Choose OmniBuf Over Cap'n Proto
  • ✓ 36% smaller network packets without 64-bit pointer fat or 8-byte word padding.
  • ✓ 12x faster encoding with zero heap allocations.
  • ✓ Over 6x faster full decoding and nearly 3x faster single-field reads on framed network packets.
  • ✓ Uses standard .proto schemas and supports raw message concatenation.
When Cap'n Proto Wins
  • → Includes a built-in RPC system with promise pipelining (chaining dependent RPC calls in a single network round-trip).
  • → Fixed-offset struct layout allows jumping straight to fields in very large messages without scanning preceding field headers.
OmniBuf vs. MessagePack
OmniBuf MessagePack
WIRE SIZE ENCODE SPEED DECODE & SKIP MEMORY EFFICIENCY SIMPLICITY

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.

Why Choose OmniBuf Over MessagePack
  • ✓ 45% smaller packets in standard .proto mode, and 5% smaller even with Field #0 inline names enabled.
  • ✓ 16x faster encoding (or over 6x faster with Field #0 inline field names included).
  • ✓ Over 20x faster full decoding and over 8x faster single-field skipping.
  • ✓ Hoists nested child schemas into Field #0 once per message instead of repeating key strings inside every array element.
When MessagePack Wins
  • → Supports arbitrary schema-free maps with heterogeneous keys when no .proto structure exists.
OmniBuf vs. JSON
OmniBuf JSON
WIRE SIZE ENCODE SPEED DECODE & SKIP MEMORY EFFICIENCY SIMPLICITY

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.

Why Choose OmniBuf Over JSON
  • ✓ 55% smaller on the wire (and 23% smaller even when Field #0 field names are embedded).
  • ✓ 17x faster encoding and 32x faster decoding.
  • ✓ 55x faster single-field extraction without parsing text brackets or quotes.
  • ✓ Compatible with official ProtoJSON so you can still accept or emit plain text JSON from the same .proto schema.
When JSON Wins
  • → Readable as plain text in browser devtools and curl when no decoder tool is available.
Benchmark Environment & Workload Details
Hardware & Runtime
CPU: Apple M1 Pro (darwin/arm64)
Compiler: Go 1.27.1
Command: just bench
All benchmarks serialize and deserialize an identical 11-field BGP/Telemetry PeerUpdate message containing unsigned and ZigZag-signed integers, booleans, IEEE-754 floats, string lists, packed integer arrays, a 6-field nested Location sub-message, and a 4-element repeated Neighbor sub-message list.