Skip to content
Projects

djkoloski/rust_serialization_benchmark

View on GitHub

djkoloski/rust_serialization_benchmark has 1,021 GitHub stars and 89 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-09 12:23 UTC. Last push 2026-10-06.

How these counts are measured

Benchmarks for rust serialization frameworks

Measured star growth

in 24h
0
in 7 days
Update delayed
in 15 days
Update delayed
in 1 month
Update delayed

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

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:

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-11-05 07:40:20

Runtime info

rustc version

rustc 1.101.0-nightly (2d20b42b8 2026-11-04)
binary: rustc
commit-hash: 2d20b42b883dcfc014f3c2c56081eeb6091c2179
commit-date: 2026-11-04
host: x86_64-unknown-linux-gnu
release: 1.101.0-nightly
LLVM version: 23.1.5

CPU info

Architecture:                            x86_64
CPU op-mode(s):                          32-bit, 64-bit
Address sizes:                           48 bits physical, 48 bits virtual
Byte Order:                              Little Endian
CPU(s):                                  4
On-line CPU(s) list:                     0-3
Vendor ID:                               GenuineIntel
Model name:                              Intel(R) Xeon(R) 6975P-C
CPU family:                              6
Model:                                   173
Thread(s) per core:                      2
Core(s) per socket:                      2
Socket(s):                               1
Stepping:                                1
BogoMIPS:                                5400.00
Flags:                                   fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq monitor vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves avx_vnni avx512_bf16 wbnoinvd ida arat vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq rdpid bus_lock_detect cldemote movdiri movdir64b md_clear serialize amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities
Virtualization:                          VT-x
Hypervisor vendor:                       KVM
Virtualization type:                     full
L1d cache:                               96 KiB (2 instances)
L1i cache:                               128 KiB (2 instances)
L2 cache:                                4 MiB (2 instances)
L3 cache:                                480 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-3
Vulnerability Gather data sampling:      Not affected
Vulnerability Ghostwrite:                Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Old microcode:             Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; Enhanced / Automatic IBRS; IBPB conditional; PBRSB-eIBRS Not affected; BHI BHI_DIS_S
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

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.3 299.13 µs* 288.19 µs* 2.2143 ms 737.86 µs 804955 328941 284849 2.7149 ms
bin-proto 0.12.9 2.5727 ms 3.5029 ms † 1045784 373127 311553 3.3208 ms
bitcode 0.6.9 174.69 µs 1.4353 ms 43.976 µs 703710 288826 227322 1.7838 ms
borsh 1.8.1 322.62 µs 1.9068 ms † 885780 362204 286248 2.7188 ms
capnp:
capnp 0.27.3
460.70 µs 1.0931 ms* † † 1443216 1046865* 513986 481681* 426532 458024* 4.4787 ms 3.8625 ms*
cbor:
cbor4ii 1.2.4
386.41 µs 4.1965 ms 2.6881 ms 1407835 403440 323561 3.6076 ms
cbor:
ciborium 0.2.2
1.7137 ms 7.3657 ms † 1407835 403440 323561 3.4891 ms
flatbuffers 25.12.19 700.65 µs † † 1276368 468539 388381 3.6639 ms
flexbuffers 25.12.19 4.5973 ms 4.8646 ms 3.4287 ms 1829756 714318 691541 6.4593 ms
json:
flexon 0.4.9
1.4620 ms 2.7242 ms † 1827461 470560 360727 4.1367 ms
json:
serde_json 1.0.154
2.3290 ms 4.5987 ms † 1827461 470560 360727 4.2899 ms
json:
simd-json 0.19.0
1.5254 ms 3.9868 ms † 1827461 470560 360727 4.3269 ms
messagepack:
msgpacker 0.7.2
272.49 µs 2.2045 ms 783.67 µs 764996 315291 264212 2.5442 ms
messagepack:
rmp-serde 1.3.1
1.0583 ms 2.5270 ms 1.1432 ms 784997 325384 277608 2.7395 ms
messagepack:
zerompk 0.8.0
277.13 µs 2.0454 ms 726.79 µs 784997 325384 277608 2.6926 ms
minicbor 2.3.1 314.30 µs 2.3675 ms 1.0465 ms 817830 332671 284034 2.9202 ms
nanoserde 0.2.1 189.30 µs 1.8429 ms † 1045784 373127 311553 3.0012 ms
postcard 1.1.3 256.27 µs 1.9480 ms 500.25 µs 724953 302399 252968 2.2717 ms
protobuf:
buffa 0.9.2
674.02 µs* 2.1060 ms* 2.3432 ms* 2.4383 ms* 1.2781 ms 884628 363130 314959 3.1816 ms
protobuf:
prost 0.14.4
768.36 µs* 2.2703 ms* 2.7265 ms* 2.7853 ms* † 884628 363130 314959 3.2162 ms
protobuf:
protobuf 3.7.2
754.67 µs* 2.6141 ms* 3.0688 ms* 3.1367 ms* † 884628 363130 314959 3.2321 ms
protobuf:
protobuf 4.36.2-release
1.4951 ms* 6.8149 ms* 5.5085 ms* 2.1705 ms* † 884628 363130 314959 3.2259 ms
rkyv 0.8.18 222.22 µs 1.4616 ms* 1.8219 ms* † 1011488 393526 325965 3.2811 ms
ron 0.12.3 7.3466 ms 18.370 ms 16.654 ms 1607459 449158 349324 4.3882 ms
savefile 0.20.6 134.56 µs 1.7981 ms † 1045800 373139 311562 2.9888 ms
serde-zap 0.1.1 145.77 µs 1.9599 ms 467.62 µs 741295 303944 256422 2.4647 ms
wincode 0.6.3 145.06 µs 1.6440 ms 343.74 µs 1045784 373127 311553 3.0337 ms

Zero-copy deserialization speed

Crate Access Read Update
capnp:
capnp 0.27.3
43.563 ns* 774.02 µs* 83.616 µs* ‡
flatbuffers 25.12.19 1.1243 ns* 1.3955 ms* 32.220 µs* 1.4387 ms* ‡
rkyv 0.8.18 340.35 µs* 7.8456 µs* 349.66 µs* 7.7040 µ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.3 44.98%* 46.69%* 64.82% 5.96% 87.42% 87.80% 79.80% 65.70%
bin-proto 0.12.9 5.23% 40.97% † 67.29% 77.41% 72.96% 53.72%
bitcode 0.6.9 77.03% 100.00% 100.00% 100.00% 100.00% 100.00% 100.00%
borsh 1.8.1 41.71% 75.27% † 79.45% 79.74% 79.41% 65.61%
capnp:
capnp 0.27.3
29.21% 12.31%* † † 48.76% 67.22%* 56.19% 59.96%* 53.30% 49.63%* 39.83% 46.18%*
cbor:
cbor4ii 1.2.4
34.82% 34.20% 1.64% 49.99% 71.59% 70.26% 49.45%
cbor:
ciborium 0.2.2
7.85% 19.49% † 49.99% 71.59% 70.26% 51.12%
flatbuffers 25.12.19 19.21% † † 55.13% 61.64% 58.53% 48.69%
flexbuffers 25.12.19 2.93% 29.50% 1.28% 38.46% 40.43% 32.87% 27.62%
json:
flexon 0.4.9
9.20% 52.69% † 38.51% 61.38% 63.02% 43.12%
json:
serde_json 1.0.154
5.78% 31.21% † 38.51% 61.38% 63.02% 41.58%
json:
simd-json 0.19.0
8.82% 36.00% † 38.51% 61.38% 63.02% 41.23%
messagepack:
msgpacker 0.7.2
49.38% 65.11% 5.61% 91.99% 91.61% 86.04% 70.11%
messagepack:
rmp-serde 1.3.1
12.71% 56.80% 3.85% 89.64% 88.76% 81.89% 65.11%
messagepack:
zerompk 0.8.0
48.55% 70.17% 6.05% 89.64% 88.76% 81.89% 66.25%
minicbor 2.3.1 42.81% 60.63% 4.20% 86.05% 86.82% 80.03% 61.08%
nanoserde 0.2.1 71.08% 77.88% † 67.29% 77.41% 72.96% 59.44%
postcard 1.1.3 52.51% 73.68% 8.79% 97.07% 95.51% 89.86% 78.52%
protobuf:
buffa 0.9.2
19.96%* 6.39%* 61.25%* 58.86%* 3.44% 79.55% 79.54% 72.18% 56.07%
protobuf:
prost 0.14.4
17.51%* 5.93%* 52.64%* 51.53%* † 79.55% 79.54% 72.18% 55.46%
protobuf:
protobuf 3.7.2
17.83%* 5.15%* 46.77%* 45.76%* † 79.55% 79.54% 72.18% 55.19%
protobuf:
protobuf 4.36.2-release
9.00%* 1.97%* 26.06%* 66.13%* † 79.55% 79.54% 72.18% 55.30%
rkyv 0.8.18 60.55% 98.20%* 78.78%* † 69.57% 73.39% 69.74% 54.37%
ron 0.12.3 1.83% 7.81% 0.26% 43.78% 64.30% 65.07% 40.65%
savefile 0.20.6 100.00% 79.82% † 67.29% 77.40% 72.96% 59.68%
serde-zap 0.1.1 92.31% 73.23% 9.40% 94.93% 95.03% 88.65% 72.37%
wincode 0.6.3 92.76% 87.31% 12.79% 67.29% 77.41% 72.96% 58.80%

Zero-copy deserialization speed

Crate Access Read Update
capnp:
capnp 0.27.3
2.58%* 1.01%* 9.38%* ‡
flatbuffers 25.12.19 100.00%* 0.00%* 24.35%* 0.55%* ‡
rkyv 0.8.18 0.00%* 100.00%* 2.24%* 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.3 3.7032 ms* 3.6884 ms* 5.7236 ms 8625005 6443961 6231572 50.539 ms
bin-proto 0.12.9 5.2260 ms 7.1603 ms 6000008 5378500 5346908 7.1305 ms
bitcode 0.6.9 1.0012 ms 533.75 µs 6000006 5182295 4921841 11.857 ms
borsh 1.8.1 3.1917 ms 3.5318 ms 6000004 5378496 5346866 7.1952 ms
capnp:
capnp 0.27.3
7.3529 ms 14.322 ms* † 14000088 10401737* 7130367 7308001* 6046182 7922110* 59.990 ms 48.510 ms*
cbor:
cbor4ii 1.2.4
4.3748 ms 34.767 ms 13125016 7524114 6757437 65.891 ms
cbor:
ciborium 0.2.2
38.030 ms 76.858 ms 13122324 7524660 6759128 65.600 ms
flatbuffers 25.12.19 618.11 µs † 6000024 5378434 5346878 8.0368 ms
flexbuffers 25.12.19 70.650 ms 49.141 ms 26609424 11901040 12486322 115.21 ms
json:
flexon 0.4.9
58.421 ms 36.451 ms 26192883 9566084 8584671 121.20 ms
json:
serde_json 1.0.154
60.056 ms 68.771 ms 26192883 9566084 8584671 123.05 ms
json:
simd-json 0.19.0
41.135 ms 83.857 ms 26192883 9566084 8584671 125.27 ms
messagepack:
msgpacker 0.7.2
591.50 µs 3.3739 ms 7500005 6058442 6014500 9.2120 ms
messagepack:
rmp-serde 1.3.1
11.746 ms 8.4254 ms 8125006 6494876 6391037 47.793 ms
messagepack:
zerompk 0.8.0
666.16 µs 2.2628 ms 8125006 6494876 6391037 46.515 ms
minicbor 2.3.1 2.2999 ms 8.5380 ms 8125006 6494907 6390894 47.558 ms
nanoserde 0.2.1 1.8424 ms 585.27 µs 6000008 5378500 5346908 7.4585 ms
postcard 1.1.3 411.56 µs 1.0549 ms 6000003 5378495 5346897 7.5956 ms
protobuf:
buffa 0.9.2
5.1553 ms* 7.5596 ms* 11.310 ms* 11.124 ms* 8750000 6665735 6421877 50.435 ms
protobuf:
prost 0.14.4
3.7800 ms* 4.4343 ms* 9.5633 ms* 9.8617 ms* 8750000 6665735 6421877 51.746 ms
protobuf:
protobuf 3.7.2
10.751 ms* 28.402 ms* 23.424 ms* 23.723 ms* 8750000 6665735 6421877 49.776 ms
protobuf:
protobuf 4.36.2-release
33.780 ms* 117.06 ms* 46.412 ms* 25.965 ms* 8750000 6665735 6421877 48.600 ms
rkyv 0.8.18 447.97 µs 405.36 µs* 407.45 µs* 6000008 5378500 5346872 7.4635 ms
ron 0.12.3 137.99 ms 353.74 ms 22192583 8971224 8138029 118.02 ms
savefile 0.20.6 405.78 µs 405.22 µs 6000024 5378519 5346896 7.6748 ms
serde-zap 0.1.1 462.82 µs 1.4890 ms 6000005 5378497 5346882 7.5798 ms
wincode 0.6.3 408.18 µs 407.75 µs 6000008 5378500 5346908 7.7435 ms

Zero-copy deserialization speed

Crate Access Read Update
capnp:
capnp 0.27.3
55.698 ns* 10.054 ms* 1.3327 ms* ‡
flatbuffers 25.12.19 1.2998 ns* 34.836 ns* 28.996 µs* 35.468 µs* ‡
rkyv 0.8.18 3.6742 ns* 21.203 µs* 19.555 µs* 202.19 µs*

Comparison

Relative to best. Higher is better.

Serialize / deserialize speed and size

Crate Serialize Deserialize Size Zlib Zstd Zstd Time
bilrost 0.1016.3 10.96%* 11.00%* 7.08% 69.57% 80.42% 78.98% 14.11%
bin-proto 0.12.9 7.76% 5.66% 100.00% 96.35% 92.05% 100.00%
bitcode 0.6.9 40.53% 75.92% 100.00% 100.00% 100.00% 60.14%
borsh 1.8.1 12.71% 11.47% 100.00% 96.35% 92.05% 99.10%
capnp:
capnp 0.27.3
5.52% 2.83%* † 42.86% 57.68%* 72.68% 70.91%* 81.40% 62.13%* 11.89% 14.70%*
cbor:
cbor4ii 1.2.4
9.28% 1.17% 45.71% 68.88% 72.84% 10.82%
cbor:
ciborium 0.2.2
1.07% 0.53% 45.72% 68.87% 72.82% 10.87%
flatbuffers 25.12.19 65.65% † 100.00% 96.35% 92.05% 88.72%
flexbuffers 25.12.19 0.57% 0.82% 22.55% 43.54% 39.42% 6.19%
json:
flexon 0.4.9
0.69% 1.11% 22.91% 54.17% 57.33% 5.88%
json:
serde_json 1.0.154
0.68% 0.59% 22.91% 54.17% 57.33% 5.79%
json:
simd-json 0.19.0
0.99% 0.48% 22.91% 54.17% 57.33% 5.69%
messagepack:
msgpacker 0.7.2
68.60% 12.01% 80.00% 85.54% 81.83% 77.40%
messagepack:
rmp-serde 1.3.1
3.45% 4.81% 73.85% 79.79% 77.01% 14.92%
messagepack:
zerompk 0.8.0
60.91% 17.91% 73.85% 79.79% 77.01% 15.33%
minicbor 2.3.1 17.64% 4.75% 73.85% 79.79% 77.01% 14.99%
nanoserde 0.2.1 22.02% 69.24% 100.00% 96.35% 92.05% 95.60%
postcard 1.1.3 98.60% 38.41% 100.00% 96.35% 92.05% 93.88%
protobuf:
buffa 0.9.2
7.87%* 5.37%* 3.58%* 3.64%* 68.57% 77.75% 76.64% 14.14%
protobuf:
prost 0.14.4
10.73%* 9.15%* 4.24%* 4.11%* 68.57% 77.75% 76.64% 13.78%
protobuf:
protobuf 3.7.2
3.77%* 1.43%* 1.73%* 1.71%* 68.57% 77.75% 76.64% 14.33%
protobuf:
protobuf 4.36.2-release
1.20%* 0.35%* 0.87%* 1.56%* 68.57% 77.75% 76.64% 14.67%
rkyv 0.8.18 90.58% 99.97%* 99.45%* 100.00% 96.35% 92.05% 95.54%
ron 0.12.3 0.29% 0.11% 27.04% 57.77% 60.48% 6.04%
savefile 0.20.6 100.00% 100.00% 100.00% 96.35% 92.05% 92.91%
serde-zap 0.1.1 87.68% 27.21% 100.00% 96.35% 92.05% 94.07%
wincode 0.6.3 99.41% 99.38% 100.00% 96.35% 92.05% 92.08%

Zero-copy deserialization speed

Crate Access Read Update
capnp:
capnp 0.27.3
2.33%* 0.19%* 1.47%* ‡
flatbuffers 25.12.19 100.00%* 3.73%* 67.44%* 55.13%* ‡
rkyv 0.8.18 35.38%* 92.23%* 100.00%* 100.00%*

minecraft_savedata

This data set is composed of Minecraft player saves that contain highly structured data.

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.3 771.35 µs* 689.52 µs* 2.6340 ms 1.3799 ms 489348 281173 249360 1.8929 ms
bin-proto 0.12.9 1.2384 ms 2.3004 ms † 566975 239350 231475 1.7714 ms
bitcode 0.6.9 119.56 µs 1.1376 ms 114.18 µs 327688 200947 182040 585.67 µs
borsh 1.8.1 358.92 µs 1.5233 ms † 446595 234236 209834 1.4629 ms
capnp:
capnp 0.27.3
374.37 µs 761.73 µs* † † 803896 489017* 335606 293127* 280744 271528* 2.5445 ms 1.7616 ms*
cbor:
cbor4ii 1.2.4
576.53 µs 3.5090 ms 2.3253 ms 1109831 344745 274333 2.5725 ms
cbor:
ciborium 0.2.2
2.2748 ms 6.6213 ms † 1109821 344751 274345 2.5465 ms
flatbuffers 25.12.19 2.8047 ms † † 849472 347816 294871 2.5211 ms
flexbuffers 25.12.19 5.5258 ms 4.7067 ms 3.6259 ms 1187688 557642 553730 4.3861 ms
json:
flexon 0.4.9
1.8167 ms 3.3548 ms † 1623191 466527 359157 4.4098 ms
json:
serde_json 1.0.154
2.3902 ms 5.5406 ms † 1623191 466527 359157 4.3234 ms
json:
simd-json 0.19.0
1.7055 ms 3.7868 ms † 1623191 466527 359157 4.4276 ms
messagepack:
msgpacker 0.7.2
276.00 µs 2.3049 ms 1.0249 ms 391251 236877 220395 1.5055 ms
messagepack:
rmp-serde 1.3.1
1.0760 ms 2.3550 ms 1.2733 ms 424533 245214 226077 1.5833 ms
messagepack:
zerompk 0.8.0
286.64 µs 1.8912 ms 804.57 µs 416025 243812 224965 1.6160 ms
minicbor 2.3.1 436.93 µs 2.7941 ms 1.4805 ms 428773 249857 228630 1.6013 ms
nanoserde 0.2.1 224.94 µs 1.6316 ms † 567975 239930 231872 1.7512 ms
postcard 1.1.3 303.88 µs 1.6953 ms 617.97 µs 367489 221913 207244 1.3955 ms
protobuf:
buffa 0.9.2
783.35 µs* 2.4421 ms* 2.6332 ms* 2.7512 ms* 1.5800 ms 596811 305319 268737 2.1972 ms
protobuf:
prost 0.14.4
1.1474 ms* 2.7151 ms* 2.8529 ms* 2.9444 ms* † 596811 305319 268737 2.1872 ms
protobuf:
protobuf 3.7.2
937.99 µs* 2.6952 ms* 3.0078 ms* 3.2003 ms* † 596811 305319 268737 2.1833 ms
protobuf:
protobuf 4.36.2-release
1.5522 ms* 6.4421 ms* 4.9353 ms* 2.1665 ms* † 596811 305319 268737 2.1192 ms
rkyv 0.8.18 238.67 µs 1.3323 ms* 1.6729 ms* † 603776 254776 219421 1.7132 ms
ron 0.12.3 6.0534 ms 18.572 ms 17.112 ms 1465219 434943 342891 4.2140 ms
savefile 0.20.6 163.62 µs 1.6010 ms † 566991 239362 231478 1.7843 ms
serde-zap 0.1.1 168.47 µs 1.6291 ms 535.10 µs 367413 221291 206242 1.4710 ms
wincode 0.6.3 167.32 µs 1.5747 ms 460.74 µs 566975 239350 231475 1.7744 ms

Zero-copy deserialization speed

Crate Access Read Update
capnp:
capnp 0.27.3
43.197 ns* 432.27 µs* 320.46 ns* ‡
flatbuffers 25.12.19 1.3061 ns* 1.5339 ms* 1.0138 µs* 1.5403 ms* ‡
rkyv 0.8.18 296.82 µs* 79.118 ns* 296.78 µs* 1.0764 µ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.3 15.50%* 17.34%* 43.19% 8.27% 66.96% 71.47% 73.00% 30.94%
bin-proto 0.12.9 9.65% 49.45% † 57.80% 83.96% 78.64% 33.06%
bitcode 0.6.9 100.00% 100.00% 100.00% 100.00% 100.00% 100.00% 100.00%
borsh 1.8.1 33.31% 74.68% † 73.37% 85.79% 86.75% 40.03%
capnp:
capnp 0.27.3
31.94% 15.70%* † † 40.76% 67.01%* 59.88% 68.55%* 64.84% 67.04%* 23.02% 33.25%*
cbor:
cbor4ii 1.2.4
20.74% 32.42% 4.91% 29.53% 58.29% 66.36% 22.77%
cbor:
ciborium 0.2.2
5.26% 17.18% † 29.53% 58.29% 66.35% 23.00%
flatbuffers 25.12.19 4.26% † † 38.58% 57.77% 61.74% 23.23%
flexbuffers 25.12.19 2.16% 24.17% 3.15% 27.59% 36.04% 32.88% 13.35%
json:
flexon 0.4.9
6.58% 33.91% † 20.19% 43.07% 50.69% 13.28%
json:
serde_json 1.0.154
5.00% 20.53% † 20.19% 43.07% 50.69% 13.55%
json:
simd-json 0.19.0
7.01% 30.04% † 20.19% 43.07% 50.69% 13.23%
messagepack:
msgpacker 0.7.2
43.32% 49.36% 11.14% 83.75% 84.83% 82.60% 38.90%
messagepack:
rmp-serde 1.3.1
11.11% 48.31% 8.97% 77.19% 81.95% 80.52% 36.99%
messagepack:
zerompk 0.8.0
41.71% 60.15% 14.19% 78.77% 82.42% 80.92% 36.24%
minicbor 2.3.1 27.36% 40.71% 7.71% 76.42% 80.42% 79.62% 36.57%
nanoserde 0.2.1 53.15% 69.72% † 57.69% 83.75% 78.51% 33.44%
postcard 1.1.3 39.34% 67.10% 18.48% 89.17% 90.55% 87.84% 41.97%
protobuf:
buffa 0.9.2
15.26%* 4.90%* 43.20%* 41.35%* 7.23% 54.91% 65.82% 67.74% 26.66%
protobuf:
prost 0.14.4
10.42%* 4.40%* 39.88%* 38.64%* † 54.91% 65.82% 67.74% 26.78%
protobuf:
protobuf 3.7.2
12.75%* 4.44%* 37.82%* 35.55%* † 54.91% 65.82% 67.74% 26.82%
protobuf:
protobuf 4.36.2-release
7.70%* 1.86%* 23.05%* 52.51%* † 54.91% 65.82% 67.74% 27.64%
rkyv 0.8.18 50.09% 85.39%* 68.00%* † 54.27% 78.87% 82.96% 34.19%
ron 0.12.3 1.98% 6.13% 0.67% 22.36% 46.20% 53.09% 13.90%
savefile 0.20.6 73.07% 71.06% † 57.79% 83.95% 78.64% 32.82%
serde-zap 0.1.1 70.97% 69.83% 21.34% 89.19% 90.81% 88.27% 39.81%
wincode 0.6.3 71.46% 72.24% 24.78% 57.80% 83.96% 78.64% 33.01%

Zero-copy deserialization speed

Crate Access Read Update
capnp:
capnp 0.27.3
3.02%* 0.02%* 24.69%* ‡
flatbuffers 25.12.19 100.00%* 0.00%* 7.80%* 0.01%* ‡
rkyv 0.8.18 0.00%* 100.00%* 0.03%* 100.00%*

mk48

This data set is composed of mk48.io game updates that contain data with many exploitable patterns and invariants.

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.3 3.7833 ms* 2.0454 ms* 6.1462 ms 1704643 1294259 1245668 8.4680 ms
bin-proto 0.12.9 3.6624 ms 4.9717 ms 1791489 1127998 1051146 7.4287 ms
bitcode 0.6.9 623.92 µs 2.1009 ms 971318 878034 850340 2.3494 ms
borsh 1.8.1 1.6902 ms 2.5950 ms 1521989 1108471 1038528 7.0873 ms
capnp:
capnp 0.27.3
1.9253 ms 3.1336 ms* † 2724288 1616255* 1546992 1278764* 1239111 1125654* 11.076 ms 6.1262 ms*
cbor:
cbor4ii 1.2.4
2.1123 ms 12.830 ms 6012539 1695215 1464951 17.034 ms
cbor:
ciborium 0.2.2
13.447 ms 30.334 ms 6012373 1695146 1465025 17.684 ms
flatbuffers 25.12.19 3.4793 ms † 2325620 1439185 1268060 10.135 ms
flexbuffers 25.12.19 26.901 ms 22.738 ms 5352680 2658295 2777967 25.654 ms
json:
flexon 0.4.9
8.5675 ms 15.612 ms 9390461 2391679 1842767 29.966 ms
json:
serde_json 1.0.154
13.097 ms 24.012 ms 9390461 2391679 1842767 29.560 ms
json:
simd-json 0.19.0
8.1264 ms 29.568 ms 9390461 2391679 1842767 30.003 ms
messagepack:
msgpacker 0.7.2
839.90 µs 4.1836 ms 1458773 1156055 1137788 6.9258 ms
messagepack:
rmp-serde 1.3.1
6.8506 ms 7.5360 ms 1745322 1261627 1228923 8.5976 ms
messagepack:
zerompk 0.8.0
901.07 µs 3.9965 ms 1675866 1230968 1195006 7.9826 ms
minicbor 2.3.1 1.7581 ms 8.2901 ms 1777386 1276218 1252558 8.9882 ms
nanoserde 0.2.1 804.37 µs 2.2614 ms 1812404 1134820 1053109 7.6628 ms
postcard 1.1.3 1.3872 ms 3.3196 ms 1311281 1083900 1041434 6.0958 ms
protobuf:
buffa 0.9.2
2.9447 ms* 6.5807 ms* 6.6330 ms* 7.6940 ms* 1859886 1338076 1295351 8.9902 ms
protobuf:
prost 0.14.4
5.7097 ms* 8.8807 ms* 6.4253 ms* 6.9998 ms* 1859886 1338076 1295351 9.0573 ms
protobuf:
protobuf 3.7.2
4.0397 ms* 10.194 ms* 9.4447 ms* 10.155 ms* 1859886 1338076 1295351 9.0651 ms
protobuf:
protobuf 4.36.2-release
6.5065 ms* 24.039 ms* 16.808 ms* 7.7071 ms* 1859886 1338076 1295351 8.7971 ms
rkyv 0.8.18 738.46 µs 1.9026 ms* 2.4200 ms* 2075936 1383779 1210377 9.4053 ms
ron 0.12.3 34.368 ms 110.53 ms 8677703 2233642 1826180 29.927 ms
savefile 0.20.6 564.17 µs 2.3071 ms 1791505 1128012 1051153 7.4645 ms
serde-zap 0.1.1 735.09 µs 3.4478 ms 1406257 1117802 1062438 6.7743 ms
wincode 0.6.3 518.31 µs 1.9917 ms 1791489 1127998 1051146 7.6447 ms

Zero-copy deserialization speed

Crate Access Read Update
capnp:
capnp 0.27.3
43.102 ns* 1.5510 ms* 312.56 ns* ‡
flatbuffers 25.12.19 1.3071 ns* 3.7758 ms* 1.9049 µs* 3.7849 ms* ‡
rkyv 0.8.18 435.94 µs* 185.97 ns* 436.00 µs* 311.17 ns*

Comparison

Relative to best. Higher is better.

Serialize / deserialize speed and size

Crate Serialize Deserialize Size Zlib Zstd Zstd Time
bilrost 0.1016.3 13.70%* 25.34%* 30.96% 56.98% 67.84% 68.26% 27.74%
bin-proto 0.12.9 14.15% 38.27% 54.22% 77.84% 80.90% 31.63%
bitcode 0.6.9 83.07% 90.56% 100.00% 100.00% 100.00% 100.00%
borsh 1.8.1 30.67% 73.32% 63.82% 79.21% 81.88% 33.15%
capnp:
capnp 0.27.3
26.92% 16.54%* † 35.65% 60.10%* 56.76% 68.66%* 68.63% 75.54%* 21.21% 38.35%*
cbor:
cbor4ii 1.2.4
24.54% 14.83% 16.15% 51.79% 58.05% 13.79%
cbor:
ciborium 0.2.2
3.85% 6.27% 16.16% 51.80% 58.04% 13.29%
flatbuffers 25.12.19 14.90% † 41.77% 61.01% 67.06% 23.18%
flexbuffers 25.12.19 1.93% 8.37% 18.15% 33.03% 30.61% 9.16%
json:
flexon 0.4.9
6.05% 12.19% 10.34% 36.71% 46.14% 7.84%
json:
serde_json 1.0.154
3.96% 7.92% 10.34% 36.71% 46.14% 7.95%
json:
simd-json 0.19.0
6.38% 6.43% 10.34% 36.71% 46.14% 7.83%
messagepack:
msgpacker 0.7.2
61.71% 45.48% 66.58% 75.95% 74.74% 33.92%
messagepack:
rmp-serde 1.3.1
7.57% 25.25% 55.65% 69.60% 69.19% 27.33%
messagepack:
zerompk 0.8.0
57.52% 47.61% 57.96% 71.33% 71.16% 29.43%
minicbor 2.3.1 29.48% 22.95% 54.65% 68.80% 67.89% 26.14%
nanoserde 0.2.1 64.44% 84.13% 53.59% 77.37% 80.75% 30.66%
postcard 1.1.3 37.36% 57.31% 74.07% 81.01% 81.65% 38.54%
protobuf:
buffa 0.9.2
17.60%* 7.88%* 28.68%* 24.73%* 52.22% 65.62% 65.65% 26.13%
protobuf:
prost 0.14.4
9.08%* 5.84%* 29.61%* 27.18%* 52.22% 65.62% 65.65% 25.94%
protobuf:
protobuf 3.7.2
12.83%* 5.08%* 20.14%* 18.74%* 52.22% 65.62% 65.65% 25.92%
protobuf:
protobuf 4.36.2-release
7.97%* 2.16%* 11.32%* 24.69%* 52.22% 65.62% 65.65% 26.71%
rkyv 0.8.18 70.19% 100.00%* 78.62%* 46.79% 63.45% 70.25% 24.98%
ron 0.12.3 1.51% 1.72% 11.19% 39.31% 46.56% 7.85%
savefile 0.20.6 91.87% 82.47% 54.22% 77.84% 80.90% 31.47%
serde-zap 0.1.1 70.51% 55.18% 69.07% 78.55% 80.04% 34.68%
wincode 0.6.3 100.00% 95.53% 54.22% 77.84% 80.90% 30.73%

Zero-copy deserialization speed

Crate Access Read Update
capnp:
capnp 0.27.3
3.03%* 0.01%* 59.50%* ‡
flatbuffers 25.12.19 100.00%* 0.00%* 9.76%* 0.00%* ‡
rkyv 0.8.18 0.00%* 100.00%* 0.04%* 100.00%*

Footnotes:

* mouse over for situational details

† this deserialization capability is not supported

‡ buffer mutation is not supported (capnp and flatbuffers may but not for rust)

Explore related projects