Skip to content

Benchmarking Protobuf, FlatBuffers, and Cap'n Proto on Go and Rust

License

Notifications You must be signed in to change notification settings

kcchu/buffer-benchmarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serialization Formats Benchmarks

This repository contains benchmarking code for different serialization formats across programing languages.

Sample data came from Farcaster.

Tested

Serialization Formats

Programming Languages

  • Go
  • Rust

Results

Note Smaller is better

Go (17 Jan 2023)

Test Protobuf Protobuf (gogofaster) FlatBuffers Capnp Capnp (packed)
Encode (ns/op) 883.8 384.4 856.8 1709 2591
Decode (ns/op) 1179 496.2 18.89 830.8 1716
Wire format size (bytes) 299 299 432 440 344
Wire format size, gzipped (bytes) 323 323 406 392 368

Rust (20 Jan 2023)

Test Protobuf (rust-protobuf) Protobuf (prost) FlatBuffers
Encode (ns/op) 704.88 642.90 878.02
Decode (ns/op) 751.61 1058.7 331.12
Wire format size (bytes) 299 299 428