kcchu / buffer-benchmarks

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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

License:Apache License 2.0


Languages

Language:Rust 86.7%Language:Go 11.5%Language:Cap'n Proto 1.1%Language:Dockerfile 0.5%Language:Makefile 0.2%