Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

rust_serialization_benchmark

> 编程语言
Open source

Benchmarks for rust serialization frameworks

1.0K stars0 likes0 views
WebsiteGitHub

About

Benchmarks for rust serialization frameworks

Rust serialization benchmark

The goal of these benchmarks is to provide thorough and complete benchmarks for various rust serialization frameworks.

Contributing

See CONTRIBUTING.md.

Maintainers

These benchmarks are maintained by a small group of volunteers. Special thanks to:

  • djkoloski
  • mumbleskates
  • finnbear

These benchmarks are a work in progress

These benchmarks are still being developed and pull requests to improve benchmarks are welcome.

Interactive site

Calculate the number of messages per second that can be sent/received with various rust serialization frameworks and compression libraries. Documentation

Format

All tests benchmark the following properties (time or size):

  • Serialize: serialize data into a buffer
  • Deserialize: deserializes a buffer into a normal rust object
  • Borrow: deserializes a buffer into a rust object that borrows string data from the input, with lifetime
  • Size: the size of the buffer when serialized
  • Zlib: the size of the buffer after zlib compression
  • Zstd: the size of the buffer after zstd compression
  • Zstd Time: the time taken to compress the serialized buffer with zstd

Zero-copy deserialization libraries have an additional set of benchmarks:

  • Access: accesses a buffer as structured data
  • Read: runs through a buffer and reads fields out of it
  • Update: updates a buffer as structured data

Some benchmark results may be italicized and followed by an asterisk. Mouse over these for more details on what situation was benchmarked. Some common terms for those variants:

  • (populate): copying or converting from the "regular" input type to the type generated by the library
  • (convert): copying or converting back from the library's generated type to the "regular" input type after deserializing

Other footnotes are located at the bottom of the page.

Last updated: 2026-09-10 21:27:58

Runtime info

rustc version

rustc 1.100.0-nightly (a36d05efa 2026-09-09)
binary: rustc
commit-hash: a36d05efab632d1ddf902b6a5c33b6d5d3b64131
commit-date: 2026-09-09
host: x86_64-unknown-linux-gnu
release: 1.100.0-nightly
LLVM version: 23.1.1

CPU info

…

log

This data set is composed of HTTP request logs that are small and contain many strings.

Raw data

For operations, time per iteration; for size, bytes. Lower is better.

Serialize / deserialize speed and size

Crate Serialize Deserialize Borrow Size Zlib Zstd Zstd Time
[bilrost 0.1016.1][bilrost] 396.57 µs* 300.26 µs* 2.1234 ms 721.18 µs 804955 328941 284849 2.7537 ms
[bin-proto 0.12.9][bin-proto] 3.4973 ms 3.7017 ms † 1045784 373127 311553 3.7491 ms
[bitcode 0.6.9][bitcode] 96.821 µs 1.1452 ms 48.400 µs 703710 288826 227322 1.8035 ms
[borsh 1.8.1][borsh] 522.21 µs 1.7294 ms † 885780 362204 286248 3.1219 ms
capnp:
[capnp 0.27.0][capnp] 480.15 µs 1.2342 ms* † † 1443216 1046865* 513986 481681* 426532 458024* 4.5887 ms 3.8565 ms*
cbor:
[cbor4ii 1.2.2][cbor4ii] 471.14 µs 4.2395 ms 3.0593 ms 1407835 403440 323561 3.4834 ms
cbor:
[ciborium 0.2.2][ciborium] 3.3751 ms 10.862 ms † 1407835 403440 323561 3.8080 ms
[flatbuffers 25.12.19][flatbuffers] 763.63 µs † † 1276368 468539 388381 3.6027 ms
[flexbuffers 25.12.19][flexbuffers] 5.4147 ms 5.7909 ms 4.4214 ms 1829756 714318 691541 6.3328 ms
json:
[flexon 0.4.8][flexon] 1.9039 ms 3.0707 ms † 1827461 470560 360727 4.5456 ms
json:
[serde_json 1.0.151][serde_json] 3.1964 ms 4.8543 ms † 1827461 470560 360727 4.1368 ms
json:
[simd-json 0.17.3][simd-json] 1.8658 ms 3.7364 ms † 1827461 470560 360727 4.1956 ms
messagepack:
[msgpacker 0.7.1][msgpacker] 266.04 µs 2.0663 ms 780.47 µs 764996 315291 264212 2.5431 ms
messagepack:
[rmp-serde 1.3.1][rmp-serde] 1.3179 ms 2.3829 ms 1.0973 ms 784997 325384 277608 2.7128 ms
messagepack:
[zerompk 0.8.0][zerompk] 269.23 µs 1.8129 ms 617.26 µs 784997 325384 277608 2.7449 ms
[minicbor 2.3.0][minicbor] 405.77 µs 2.3448 ms 1.0694 ms 817830 332671 284034 2.9185 ms
[nanoserde 0.2.1][nanoserde] 190.59 µs 1.6898 ms † 1045784 373127 311553 3.0954 ms
[postcard 1.1.3][postcard] 366.95 µs 1.7399 ms 577.43 µs 724953 302399 252968 2.3742 ms
protobuf:
[buffa 0.9.2][buffa] 687.71 µs* 1.8542 ms* 2.5264 ms* 2.6261 ms* 1.5676 ms 884628 363130 314959 3.2404 ms
protobuf:
[prost 0.14.4][prost] 731.23 µs* 1.8883 ms* 2.6802 ms* 2.7061 ms* † 884628 363130 314959 3.4973 ms
protobuf:
[protobuf 3.7.2][protobuf] 1.0383 ms* 2.4582 ms* 3.0198 ms* 3.0445 ms* † 884628 363130 314959 3.5435 ms
protobuf:
[protobuf 4.36.1-release][protobuf4] 1.4154 ms* 6.2701 ms* 5.8174 ms* 2.4705 ms* † 884628 363130 314959 3.7036 ms
[rkyv 0.8.18][rkyv] 178.87 µs 1.2188 ms* 1.5144 ms* † 1011488 393526 325965 3.3258 ms
[ron 0.12.2][ron] 9.0612 ms 21.626 ms 20.020 ms 1607459 449158 349324 4.2470 ms
[savefile 0.20.5][savefile] 154.62 µs 1.6639 ms † 1045800 373139 311562 3.1025 ms
[serde-zap 0.1.1][serde-zap] 135.54 µs 1.7212 ms 446.09 µs 741295 303944 256422 2.4440 ms
[wincode 0.6.1][wincode] 137.05 µs 1.4166 ms 300.60 µs 1045784 373127 311553 3.2193 ms

Zero-copy deserialization speed

Crate Access Read Update
capnp:
[capnp 0.27.0][capnp] 64.196 ns* 856.23 µs* 117.74 µs* ‡
[flatbuffers 25.12.19][flatbuffers] 2.1807 ns* 2.1354 ms* 42.209 µs* 2.1373 ms* ‡
[rkyv 0.8.18][rkyv] 1.0907 ns* 274.32 µs* 8.3309 µs* 279.71 µs* 4.8701 µs*

Comparison

Relative to best. Higher is better.

Serialize / deserialize speed and size

Crate Serialize Deserialize Borrow Size Zlib Zstd Zstd Time
[bilrost 0.1016.1][bilrost] 24.41%* 32.25%* 53.93% 6.71% 87.42% 87.80% 79.80% 65.49%
[bin-proto 0.12.9][bin-proto] 2.77% 30.94% † 67.29% 77.41% 72.96% 48.10%
[bitcode 0.6.9][bitcode] 100.00% 100.00% 100.00% 100.00% 100.00% 100.00% 100.00%
[borsh 1.8.1][borsh] 18.54% 66.22% † 79.45% 79.74% 79.41% 57.77%
capnp:
[capnp 0.27.0][capnp] 20.16% 7.84%* † † 48.76% 67.22%* 56.19% 59.96%* 53.30% 49.63%* 39.30% 46.77%*
cbor:
[cbor4ii 1.2.2][cbor4ii] 20.55% 27.01% 1.58% 49.99% 71.59% 70.26% 51.77%
cbor:
[ciborium 0.2.2][ciborium] 2.87% 10.54% † 49.99% 71.59% 70.26% 47.36%
[flatbuffers 25.12.19][flatbuffers] 12.68% † † 55.13% 61.64% 58.53% 50.06%
[flexbuffers 25.12.19][flexbuffers] 1.79% 19.78% 1.09% 38.46% 40.43% 32.87% 28.48%
json:
[flexon 0.4.8][flexon] 5.09% 37.29% † 38.51% 61.38% 63.02% 39.68%
json:
[serde_json 1.0.151][serde_json] 3.03% 23.59% † 38.51% 61.38% 63.02% 43.60%
json:
[simd-json 0.17.3][simd-json] 5.19% 30.65% † 38.51% 61.38% 63.02% 42.99%
messagepack:
[msgpacker 0.7.1][msgpacker] 36.39% 55.42% 6.20% 91.99% 91.61% 86.04% 70.92%
messagepack:
[rmp-serde 1.3.1][rmp-serde] 7.35% 48.06% 4.41% 89.64% 88.76% 81.89% 66.48%
messagepack:
[zerompk 0.8.0][zerompk] 35.96% 63.17% 7.84% 89.64% 88.76% 81.89% 65.70%
[minicbor 2.3.0][minicbor] 23.86% 48.84% 4.53% 86.05% 86.82% 80.03% 61.80%
[nanoserde 0.2.1][nanoserde] 50.80% 67.77% † 67.29% 77.41% 72.96% 58.26%
[postcard 1.1.3][postcard] 26.39% 65.82% 8.38% 97.07% 95.51% 89.86% 75.96%
protobuf:
[buffa 0.9.2][buffa] 14.08%* 5.22%* 45.33%* 43.61%* 3.09% 79.55% 79.54% 72.18% 55.66%
protobuf:
[prost 0.14.4][prost] 13.24%* 5.13%* 42.73%* 42.32%* † 79.55% 79.54% 72.18% 51.57%
protobuf:
[protobuf 3.7.2][protobuf] 9.32%* 3.94%* 37.92%* 37.62%* † 79.55% 79.54% 72.18% 50.90%
protobuf:
[protobuf 4.36.1-release][protobuf4] 6.84%* 1.54%* 19.69%* 46.35%* † 79.55% 79.54% 72.18% 48.70%
[rkyv 0.8.18][rkyv] 54.13% 93.96%* 75.62%* † 69.57% 73.39% 69.74% 54.23%
[ron 0.12.2][ron] 1.07% 5.30% 0.24% 43.78% 64.30% 65.07% 42.47%
[savefile 0.20.5][savefile] 62.62% 68.83% † 67.29% 77.40% 72.96% 58.13%
[serde-zap 0.1.1][serde-zap] 71.43% 66.53% 10.85% 94.93% 95.03% 88.65% 73.79%
[wincode 0.6.1][wincode] 70.65% 80.84% 16.10% 67.29% 77.41% 72.96% 56.02%

Zero-copy deserialization speed

Crate Access Read Update
capnp:
[capnp 0.27.0][capnp] 1.70%* 0.97%* 7.08%* ‡
[flatbuffers 25.12.19][flatbuffers] 50.02%* 0.00%* 19.74%* 0.39%* ‡
[rkyv 0.8.18][rkyv] 100.00%* 0.00%* 100.00%* 2.98%* 100.00%*

mesh

This data set is a single mesh. The mesh contains an array of triangles, each of which has three vertices and a normal vector.

Raw data

For operations, time per iteration; for size, bytes. Lower is better.

Serialize / deserialize speed and size

Crate Serialize Deserialize Size Zlib Zstd Zstd Time
[bilrost 0.1016.1][bilrost] 4.2651 ms* 4.3066 ms* 5.8287 ms 8625005 6443961 6231572 53.032 ms
[bin-proto 0.12.9][bin-proto] 7.7385 ms 9.4791 ms 6000008 5378500 5346908 7.3393 ms
[bitcode 0.6.9][bitcode] 1.2265 ms 1.2561 ms 6000006 5182295 4921841 11.163 ms
[borsh 1.8.1][borsh] 5.7824 ms 3.8040 ms 6000004 5378496 5346866 7.3482 ms
capnp:
[capnp 0.27.0][capnp] 7.4461 ms 15.982 ms* † 14000088 10401737* 7130367 7308001* 6046182 7922110* 61.226 ms 51.489 ms*
cbor:
[cbor4ii 1.2.2][cbor4ii] 5.5692 ms 39.178 ms 13125016 7524114 6757437 68.144 ms
cbor:
[ciborium 0.2.2][ciborium] 52.529 ms 95.267 ms 13122324 7524660 6759128 68.852 ms
[flatbuffers 25.12.19][flatbuffers] 371.26 µs † 6000024 5378434 5346878 7.2882 ms
[flexbuffers 25.12.19][flexbuffers] 83.914 ms 65.692 ms 26609424 11901040 12486322 109.11 ms
json:
[flexon 0.4.8][flexon] 59.811 ms 43.591 ms 26192883 9566084 8584671 125.26 ms
json:
[serde_json 1.0.151][serde_json] 70.183 ms 84.252 ms 26192883 9566084 8584671 125.11 ms
json:
[simd-json 0.17.3][simd-json] 46.168 ms 52.998 ms 26192883 9566084 8584671 124.73 ms
messagepack:
[msgpacker 0.7.1][msgpacker] 532.27 µs 3.2402 ms 7500005 6058442 6014500 8.7549 ms
messagepack:
[rmp-serde 1.3.1][rmp-serde] 15.828 ms 9.2506 ms 8125006 6494876 6391037 47.905 ms
messagepack:
[zerompk 0.8.0][zerompk] 545.57 µs 3.1580 ms 8125006 6494876 6391037 52.063 ms
[minicbor 2.3.0][minicbor] 2.2899 ms 9.4268 ms 8125006 6494907 6390894 51.924 ms
[nanoserde 0.2.1][nanoserde] 1.3246 ms 824.47 µs 6000008 5378500 5346908 7.2872 ms
[postcard 1.1.3][postcard] 412.78 µs 5.2192 ms 6000003 5378495 5346897 7.3596 ms
protobuf:
[buffa 0.9.2][buffa] 5.1391 ms* *7.0587

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言