djkoloski / rust_serialization_benchmark

Benchmarks for rust serialization frameworks
514 stars 48 forks source link

Rust serialization benchmark

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

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):

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

Some benchmark results may be italicized and followed by an asterisk. Mouse over these for more details on what situation was benchmarked. Other footnotes are located at the bottom.

Last updated: 2024-5-1 22:43:2

Runtime info ### `rustc` version ``` rustc 1.77.0-nightly (11f32b73e 2024-01-31) binary: rustc commit-hash: 11f32b73e0dc9287e305b5b9980d24aecdc8c17f commit-date: 2024-01-31 host: x86_64-unknown-linux-gnu release: 1.77.0-nightly LLVM version: 17.0.6 ``` ### 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: AuthenticAMD Model name: AMD EPYC 7763 64-Core Processor CPU family: 25 Model: 1 Thread(s) per core: 2 Core(s) per socket: 2 Socket(s): 1 Stepping: 1 BogoMIPS: 4890.86 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext invpcid_single vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr rdpru arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm Virtualization: AMD-V Hypervisor vendor: Microsoft Virtualization type: full L1d cache: 64 KiB (2 instances) L1i cache: 64 KiB (2 instances) L2 cache: 1 MiB (2 instances) L3 cache: 32 MiB (1 instance) NUMA node(s): 1 NUMA node0 CPU(s): 0-3 Vulnerability Gather data sampling: 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 Retbleed: Not affected Vulnerability Spec rstack overflow: Vulnerable: Safe RET, no microcode Vulnerability Spec store bypass: Vulnerable Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: 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 Size Zlib Zstd Zstd Time
abomonation 0.7.3 396.89 µs 1.4259 ms* 1705800 520083 413333 6.8709 ms
alkahest 0.1.5 182.66 µs 1045784 454157 389424 5.9628 ms
bilrost 0.1007.0 748.85 µs* 721.06 µs* 3.1539 ms 874632 355446 311723 5.0874 ms
bincode 2.0.0-rc 199.03 µs 2.3731 ms 741295 303944 257153 4.0257 ms
bincode 1.3.3 508.76 µs 1.9790 ms 1045784 373127 311761 4.8550 ms
bitcode 0.6.0 140.85 µs 1.4572 ms 703710 288826 229755 2.3215 ms
borsh 1.3.1 530.04 µs 2.2460 ms 885780 362204 286514 4.4061 ms
bson 2.9.0 2.1733 ms 6.7748 ms 1924682 532821 376270 5.6684 ms
capnp 0.18.13 465.60 µs 1443216 513986 428649 6.8480 ms
cbor4ii 0.3.2 881.63 µs 4.9518 ms 1407835 403440 324081 4.5699 ms
ciborium 0.2.2 3.8349 ms 9.9464 ms 1407835 403440 324081 4.8172 ms
databuf 0.5.0 254.38 µs 1.9857 ms 765778 311715 264630 4.0821 ms
dlhn 0.1.6 793.59 µs 2.3602 ms 724953 301446 253629 3.7064 ms
flatbuffers 23.5.26 1.3499 ms 1276368 468539 388832 5.0917 ms
msgpacker 0.4.3 1.0503 ms 2.4610 ms 764996 315291 264898 3.7032 ms
nachricht-serde 0.4.0 5.3082 ms 3.9807 ms 818669 332556 285514 4.3201 ms
nanoserde 0.1.37 264.86 µs 2.0043 ms 1045784 373127 311761 4.5312 ms
parity-scale-codec 3.6.9 653.86 µs 2.1605 ms 765778 311743 264518 4.1404 ms
postcard 1.0.8 385.94 µs 2.1636 ms 724953 302399 253747 3.8451 ms
pot 3.0.0 2.3080 ms 6.2856 ms 971922 372513 304122 4.4918 ms
prost 0.12.4 962.91 µs* 2.4720 ms* 3.3213 ms 884628 363130 315494 5.1065 ms
rkyv 0.7.44 212.40 µs 1.4220 ms* 1.9111 ms* 1011488 383862 333545 4.7282 ms
rmp-serde 1.1.2 1.2085 ms 3.3843 ms 784997 325384 278219 4.1816 ms
ron 0.8.1 13.989 ms 15.386 ms 1607459 449158 349713 5.9405 ms
savefile 0.16.5 200.22 µs 2.0962 ms 1045800 373139 311755 4.7269 ms
serde_bare 0.5.0 660.82 µs 2.0401 ms 765778 311715 264630 3.9018 ms
serde_cbor 0.11.2 2.0091 ms 4.7730 ms 1407835 403440 324081 4.4611 ms
serde_json 1.0.115 3.7995 ms 5.4105 ms 1827461 470560 361090 5.5185 ms
simd-json 0.13.9 2.0464 ms 4.5892 ms 1827461 470560 361090 5.6100 ms
speedy 0.8.7 191.38 µs 1.7059 ms 885780 362204 286514 4.2098 ms
wiring 0.2.1 194.99 µs 1.8949 ms 2091568 674994 276295 3.9933 ms

Zero-copy deserialization speed

Crate Access Read Update
abomonation 0.7.3 22.235 µs* 39.758 µs*
alkahest 0.1.5 1.8136 ns* 24.192 µs*
capnp 0.18.13 74.502 ns* 177.58 µs*
flatbuffers 23.5.26 2.3928 ns* 1.8310 ms* 50.552 µs* 1.8534 ms*
rkyv 0.7.44 1.2186 ns* 483.30 µs* 10.483 µs* 496.74 µs* 9.5373 µs

Comparison

Relative to best. Higher is better.

Serialize / deserialize speed and size

Crate Serialize Deserialize Size Zlib Zstd Zstd Time
abomonation 0.7.3 35.49% 99.73%* 41.25% 55.53% 55.59% 33.79%
alkahest 0.1.5 77.11% 67.29% 63.60% 59.00% 38.93%
bilrost 0.1007.0 18.81%* 19.53%* 45.09% 80.46% 81.26% 73.70% 45.63%
bincode 2.0.0-rc 70.77% 59.92% 94.93% 95.03% 89.35% 57.67%
bincode 1.3.3 27.68% 71.85% 67.29% 77.41% 73.70% 47.82%
bitcode 0.6.0 100.00% 97.58% 100.00% 100.00% 100.00% 100.00%
borsh 1.3.1 26.57% 63.31% 79.45% 79.74% 80.19% 52.69%
bson 2.9.0 6.48% 20.99% 36.56% 54.21% 61.06% 40.96%
capnp 0.18.13 30.25% 48.76% 56.19% 53.60% 33.90%
cbor4ii 0.3.2 15.98% 28.72% 49.99% 71.59% 70.89% 50.80%
ciborium 0.2.2 3.67% 14.30% 49.99% 71.59% 70.89% 48.19%
databuf 0.5.0 55.37% 71.61% 91.89% 92.66% 86.82% 56.87%
dlhn 0.1.6 17.75% 60.25% 97.07% 95.81% 90.59% 62.63%
flatbuffers 23.5.26 10.43% 55.13% 61.64% 59.09% 45.59%
msgpacker 0.4.3 13.41% 57.78% 91.99% 91.61% 86.73% 62.69%
nachricht-serde 0.4.0 2.65% 35.72% 85.96% 86.85% 80.47% 53.74%
nanoserde 0.1.37 53.18% 70.95% 67.29% 77.41% 73.70% 51.23%
parity-scale-codec 3.6.9 21.54% 65.82% 91.89% 92.65% 86.86% 56.07%
postcard 1.0.8 36.50% 65.72% 97.07% 95.51% 90.54% 60.38%
pot 3.0.0 6.10% 22.62% 72.40% 77.53% 75.55% 51.68%
prost 0.12.4 14.63%* 5.70%* 42.81% 79.55% 79.54% 72.82% 45.46%
rkyv 0.7.44 66.31% 100.00%* 74.41%* 69.57% 75.24% 68.88% 49.10%
rmp-serde 1.1.2 11.65% 42.02% 89.64% 88.76% 82.58% 55.52%
ron 0.8.1 1.01% 9.24% 43.78% 64.30% 65.70% 39.08%
savefile 0.16.5 70.35% 67.84% 67.29% 77.40% 73.70% 49.11%
serde_bare 0.5.0 21.31% 69.70% 91.89% 92.66% 86.82% 59.50%
serde_cbor 0.11.2 7.01% 29.79% 49.99% 71.59% 70.89% 52.04%
serde_json 1.0.115 3.71% 26.28% 38.51% 61.38% 63.63% 42.07%
simd-json 0.13.9 6.88% 30.99% 38.51% 61.38% 63.63% 41.38%
speedy 0.8.7 73.60% 83.36% 79.45% 79.74% 80.19% 55.15%
wiring 0.2.1 72.23% 75.04% 33.65% 42.79% 83.16% 58.13%

Zero-copy deserialization speed

Crate Access Read Update
abomonation 0.7.3 0.01%* 26.37%*
alkahest 0.1.5 67.19%* 43.33%*
capnp 0.18.13 1.64%* 5.90%*
flatbuffers 23.5.26 50.93%* 0.00%* 20.74%* 0.57%*
rkyv 0.7.44 100.00%* 0.00%* 100.00%* 2.11%* 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
abomonation 0.7.3 259.20 µs 259.20 µs* 6000024 5378513 5345890 7.4580 ms
alkahest 0.1.5 144.49 µs 6000008 5378500 5345890 7.3264 ms
bilrost 0.1007.0 6.4614 ms* 8.3875 ms* 10.210 ms 8625005 6443961 6231572 67.633 ms
bincode 2.0.0-rc 413.78 µs 807.08 µs 6000005 5378497 5345897 7.2359 ms
bincode 1.3.3 4.9667 ms 4.4266 ms 6000008 5378500 5345890 7.2610 ms
bitcode 0.6.0 1.3814 ms 594.88 µs 6000006 5182295 4923880 12.408 ms
borsh 1.3.1 5.7457 ms 4.4974 ms 6000004 5378496 5345889 7.3261 ms
bson 2.9.0 44.274 ms 76.062 ms 23013911 9212089 7497811 106.16 ms
capnp 0.18.13 5.4032 ms 14000088 7130367 6051062 76.929 ms
cbor4ii 0.3.2 10.305 ms 46.706 ms 13125016 7524114 6757967 91.329 ms
ciborium 0.2.2 62.728 ms 104.25 ms 13122324 7524660 6759658 91.213 ms
databuf 0.5.0 2.3402 ms 5.1656 ms 6000003 5378495 5345900 7.8404 ms
dlhn 0.1.6 6.1567 ms 6.1084 ms 6000003 5378495 5345900 7.8352 ms
flatbuffers 23.5.26 635.57 µs 6000024 5378434 5345910 8.2614 ms
msgpacker 0.4.3 18.726 ms 8.3419 ms 7500005 6058442 6014337 9.1896 ms
nachricht-serde 0.4.0 116.81 ms 25.787 ms 8125037 6493484 6386940 69.983 ms
nanoserde 0.1.37 1.1410 ms 880.91 µs 6000008 5378500 5345890 7.5005 ms
parity-scale-codec 3.6.9 4.7612 ms 4.4793 ms 6000004 5378496 5345889 7.4643 ms
postcard 1.0.8 464.95 µs 1.0257 ms 6000003 5378495 5345900 7.5195 ms
pot 3.0.0 38.400 ms 68.473 ms 10122342 6814618 6852251 79.142 ms
prost 0.12.4 7.7099 ms* 8.9102 ms* 12.980 ms 8750000 6665735 6421871 71.895 ms
rkyv 0.7.44 197.58 µs 143.63 µs* 191.60 µs* 6000008 5378500 5345892 7.3876 ms
rmp-serde 1.1.2 13.284 ms 18.399 ms 8125006 6494876 6391037 65.646 ms
ron 0.8.1 170.91 ms 244.27 ms 22192885 8970395 8138755 145.22 ms
savefile 0.16.5 258.56 µs 264.30 µs 6000024 5378518 5345893 7.6299 ms
serde_bare 0.5.0 6.0346 ms 4.1405 ms 6000003 5378495 5345900 7.0724 ms
serde_cbor 0.11.2 34.998 ms 42.701 ms 13122324 7524660 6759658 91.972 ms
serde_json 1.0.115 86.865 ms 86.672 ms 26192883 9566084 8586741 146.87 ms
simd-json 0.13.9 53.404 ms 72.123 ms 26192883 9566084 8586741 151.53 ms
speedy 0.8.7 258.75 µs 259.61 µs 6000004 5378496 5345889 7.4608 ms
wiring 0.2.1 192.65 µs 345.97 µs 12000016 10757697 10691743 14.279 ms

Zero-copy deserialization speed

Crate Access Read Update
abomonation 0.7.3 2.1130 ns* 139.94 µs*
alkahest 0.1.5 1.8149 ns* 76.002 µs*
capnp 0.18.13 103.87 ns* 2.1315 ms*
flatbuffers 23.5.26 2.4167 ns* 37.269 ns* 52.917 µs* 75.589 µs*
rkyv 0.7.44 1.1963 ns* 10.501 ns* 47.513 µs* 37.947 µs* 103.74 µs

Comparison

Relative to best. Higher is better.

Serialize / deserialize speed and size

Crate Serialize Deserialize Size Zlib Zstd Zstd Time
abomonation 0.7.3 55.74% 55.41%* 100.00% 96.35% 92.11% 94.83%
alkahest 0.1.5 100.00% 100.00% 96.35% 92.11% 96.53%
bilrost 0.1007.0 2.24%* 1.72%* 1.41% 69.57% 80.42% 79.02% 10.46%
bincode 2.0.0-rc 34.92% 17.80% 100.00% 96.35% 92.11% 97.74%
bincode 1.3.3 2.91% 3.24% 100.00% 96.35% 92.11% 97.40%
bitcode 0.6.0 10.46% 24.14% 100.00% 100.00% 100.00% 57.00%
borsh 1.3.1 2.51% 3.19% 100.00% 96.35% 92.11% 96.54%
bson 2.9.0 0.33% 0.19% 26.07% 56.26% 65.67% 6.66%
capnp 0.18.13 2.67% 42.86% 72.68% 81.37% 9.19%
cbor4ii 0.3.2 1.40% 0.31% 45.71% 68.88% 72.86% 7.74%
ciborium 0.2.2 0.23% 0.14% 45.72% 68.87% 72.84% 7.75%
databuf 0.5.0 6.17% 2.78% 100.00% 96.35% 92.11% 90.20%
dlhn 0.1.6 2.35% 2.35% 100.00% 96.35% 92.11% 90.26%
flatbuffers 23.5.26 22.73% 100.00% 96.35% 92.11% 85.61%
msgpacker 0.4.3 0.77% 1.72% 80.00% 85.54% 81.87% 76.96%
nachricht-serde 0.4.0 0.12% 0.56% 73.85% 79.81% 77.09% 10.11%
nanoserde 0.1.37 12.66% 16.30% 100.00% 96.35% 92.11% 94.29%
parity-scale-codec 3.6.9 3.03% 3.21% 100.00% 96.35% 92.11% 94.75%
postcard 1.0.8 31.08% 14.00% 100.00% 96.35% 92.11% 94.05%
pot 3.0.0 0.38% 0.21% 59.27% 76.05% 71.86% 8.94%
prost 0.12.4 1.87%* 1.62%* 1.11% 68.57% 77.75% 76.67% 9.84%
rkyv 0.7.44 73.13% 100.00%* 74.96%* 100.00% 96.35% 92.11% 95.73%
rmp-serde 1.1.2 1.09% 0.78% 73.85% 79.79% 77.04% 10.77%
ron 0.8.1 0.08% 0.06% 27.04% 57.77% 60.50% 4.87%
savefile 0.16.5 55.88% 54.34% 100.00% 96.35% 92.11% 92.69%
serde_bare 0.5.0 2.39% 3.47% 100.00% 96.35% 92.11% 100.00%
serde_cbor 0.11.2 0.41% 0.34% 45.72% 68.87% 72.84% 7.69%
serde_json 1.0.115 0.17% 0.17% 22.91% 54.17% 57.34% 4.82%
simd-json 0.13.9 0.27% 0.20% 22.91% 54.17% 57.34% 4.67%
speedy 0.8.7 55.84% 55.33% 100.00% 96.35% 92.11% 94.79%
wiring 0.2.1 75.00% 41.52% 50.00% 48.17% 46.05% 49.53%

Zero-copy deserialization speed

Crate Access Read Update
abomonation 0.7.3 56.62%* 27.12%*
alkahest 0.1.5 65.92%* 49.93%*
capnp 0.18.13 1.15%* 1.78%*
flatbuffers 23.5.26 49.50%* 3.21%* 71.71%* 50.20%*
rkyv 0.7.44 100.00%* 11.39%* 79.87%* 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 Size Zlib Zstd Zstd Time
abomonation 0.7.3 189.13 µs 1.2864 ms* 1290592 396581 340428 4.9405 ms
alkahest 0.1.5 215.46 µs 667570 325484 320452 3.9212 ms
bilrost 0.1007.0 913.57 µs* 907.73 µs* 3.0918 ms 489348 281173 249546 2.9467 ms
bincode 2.0.0-rc 265.28 µs 2.0011 ms 367413 221291 206273 2.4700 ms
bincode 1.3.3 556.06 µs 1.7457 ms 569975 240525 232423 2.8979 ms
bitcode 0.6.0 128.29 µs 1.2352 ms 327688 200947 182736 733.70 µs
borsh 1.3.1 507.27 µs 1.7852 ms 446595 234236 210008 2.4124 ms
bson 2.9.0 2.8695 ms 8.0250 ms 1619653 502185 328399 4.8497 ms
capnp 0.18.13 445.95 µs 803896 335606 280851 3.7580 ms
cbor4ii 0.3.2 775.26 µs 4.5674 ms 1109831 344745 274514 3.8469 ms
ciborium 0.2.2 3.5371 ms 9.1415 ms 1109821 344751 274526 3.8313 ms
databuf 0.5.0 317.76 µs 1.6947 ms 356311 213062 198488 2.3392 ms
dlhn 0.1.6 778.80 µs 2.4976 ms 366496 220600 205683 2.2955 ms
flatbuffers 23.5.26 3.2451 ms 844168 345696 294015 3.8138 ms
msgpacker 0.4.3 892.69 µs 2.7641 ms 391251 236877 220476 2.6233 ms
nachricht-serde 0.4.0 5.1451 ms 3.8363 ms 449745 252432 231110 2.7865 ms
nanoserde 0.1.37 279.06 µs 1.8608 ms 567975 239930 232419 2.8690 ms
parity-scale-codec 3.6.9 635.31 µs 1.9359 ms 356311 212976 198524 2.3892 ms
postcard 1.0.8 416.40 µs 1.9089 ms 367489 221913 207344 2.4792 ms
pot 3.0.0 2.2244 ms 5.7910 ms 599125 299158 247693 3.0222 ms
prost 0.12.4 1.0920 ms* 2.7315 ms* 3.5031 ms 596811 305319 269310 3.4591 ms
rkyv 0.7.44 292.37 µs 1.2343 ms* 1.7169 ms* 596952 253967 220706 2.7055 ms
rmp-serde 1.1.2 1.3293 ms 2.9953 ms 424533 245214 226188 2.6833 ms
ron 0.8.1 8.2034 ms 16.762 ms 1465223 434935 343338 5.8482 ms
savefile 0.16.5 218.31 µs 1.7571 ms 566991 239361 232010 2.7217 ms
serde_bare 0.5.0 705.86 µs 2.1442 ms 356311 213062 198488 2.3895 ms
serde_cbor 0.11.2 1.7600 ms 4.5726 ms 1109821 344751 274526 3.6903 ms
serde_json 1.0.115 3.7057 ms 6.6326 ms 1623191 466527 359623 5.8205 ms
simd-json 0.13.9 2.1494 ms 4.6101 ms 1623191 466527 359623 5.9702 ms
speedy 0.8.7 265.07 µs 1.5919 ms 449595 234970 210361 2.7660 ms
wiring 0.2.1 198.34 µs 1.7723 ms 1133950 495111 225317 2.8952 ms

Zero-copy deserialization speed

Crate Access Read Update
abomonation 0.7.3 35.922 µs* 36.565 µs*
alkahest 0.1.5 1.8124 ns* 4.5167 µs*
capnp 0.18.13 75.105 ns* 422.70 ns*
flatbuffers 23.5.26 2.4081 ns* 2.1202 ms* 1.3316 µs* 2.1162 ms*
rkyv 0.7.44 1.2024 ns* 473.33 µs* 159.90 ns* 483.66 µs* 966.66 ns

Comparison

Relative to best. Higher is better.

Serialize / deserialize speed and size

Crate Serialize Deserialize Size Zlib Zstd Zstd Time
abomonation 0.7.3 67.83% 95.95%* 25.39% 50.67% 53.68% 14.85%
alkahest 0.1.5 59.54% 49.09% 61.74% 57.02% 18.71%
bilrost 0.1007.0 14.04%* 14.13%* 39.92% 66.96% 71.47% 73.23% 24.90%
bincode 2.0.0-rc 48.36% 61.68% 89.19% 90.81% 88.59% 29.70%
bincode 1.3.3 23.07% 70.71% 57.49% 83.55% 78.62% 25.32%
bitcode 0.6.0 100.00% 99.93% 100.00% 100.00% 100.00% 100.00%
borsh 1.3.1 25.29% 69.14% 73.37% 85.79% 87.01% 30.41%
bson 2.9.0 4.47% 15.38% 20.23% 40.01% 55.64% 15.13%
capnp 0.18.13 28.77% 40.76% 59.88% 65.07% 19.52%
cbor4ii 0.3.2 16.55% 27.02% 29.53% 58.29% 66.57% 19.07%
ciborium 0.2.2 3.63% 13.50% 29.53% 58.29% 66.56% 19.15%
databuf 0.5.0 40.37% 72.83% 91.97% 94.31% 92.06% 31.37%
dlhn 0.1.6 16.47% 49.42% 89.41% 91.09% 88.84% 31.96%
flatbuffers 23.5.26 3.95% 38.82% 58.13% 62.15% 19.24%
msgpacker 0.4.3 14.37% 44.65% 83.75% 84.83% 82.88% 27.97%
nachricht-serde 0.4.0 2.49% 32.17% 72.86% 79.60% 79.07% 26.33%
nanoserde 0.1.37 45.97% 66.33% 57.69% 83.75% 78.62% 25.57%
parity-scale-codec 3.6.9 20.19% 63.76% 91.97% 94.35% 92.05% 30.71%
postcard 1.0.8 30.81% 64.66% 89.17% 90.55% 88.13% 29.59%
pot 3.0.0 5.77% 21.31% 54.69% 67.17% 73.78% 24.28%
prost 0.12.4 11.75%* 4.70%* 35.23% 54.91% 65.82% 67.85% 21.21%
rkyv 0.7.44 43.88% 100.00%* 71.89%* 54.89% 79.12% 82.80% 27.12%
rmp-serde 1.1.2 9.65% 41.21% 77.19% 81.95% 80.79% 27.34%
ron 0.8.1 1.56% 7.36% 22.36% 46.20% 53.22% 12.55%
savefile 0.16.5 58.77% 70.25% 57.79% 83.95% 78.76% 26.96%
serde_bare 0.5.0 18.17% 57.56% 91.97% 94.31% 92.06% 30.71%
serde_cbor 0.11.2 7.29% 26.99% 29.53% 58.29% 66.56% 19.88%
serde_json 1.0.115 3.46% 18.61% 20.19% 43.07% 50.81% 12.61%
simd-json 0.13.9 5.97% 26.77% 20.19% 43.07% 50.81% 12.29%
speedy 0.8.7 48.40% 77.54% 72.89% 85.52% 86.87% 26.53%
wiring 0.2.1 64.68% 69.64% 28.90% 40.59% 81.10% 25.34%

Zero-copy deserialization speed

Crate Access Read Update
abomonation 0.7.3 0.00%* 0.44%*
alkahest 0.1.5 66.34%* 3.54%*
capnp 0.18.13 1.60%* 37.83%*
flatbuffers 23.5.26 49.93%* 0.00%* 12.01%* 0.01%*
rkyv 0.7.44 100.00%* 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
abomonation 0.7.3 476.69 µs 2.2754 ms* 2984682 1406994 1270095 14.306 ms
alkahest 0.1.5 710.11 µs 1863391 1234113 1202345 11.207 ms
bilrost 0.1007.0 4.8896 ms* 2.7144 ms* 8.2818 ms 1664428 1264167 1216472 11.072 ms
bincode 2.0.0-rc 681.68 µs 3.5490 ms 1372381 1091486 1037296 8.8835 ms
bincode 1.3.3 3.5677 ms 3.8544 ms 1811011 1115281 1025627 9.7876 ms
bitcode 0.6.0 703.05 µs 2.2420 ms 948499 857321 837658 2.9688 ms
borsh 1.3.1 2.7585 ms 2.8210 ms 1486162 1082357 1013550 9.3159 ms
bson 2.9.0 21.035 ms 42.601 ms 10030880 2833079 1600859 27.245 ms
capnp 0.18.13 2.0925 ms 2664040 1511895 1212087 13.961 ms
cbor4ii 0.3.2 4.1831 ms 17.037 ms 5878791 1655835 1431390 20.481 ms
ciborium 0.2.2 22.131 ms 45.890 ms 5878653 1655791 1431560 20.335 ms
databuf 0.5.0 1.7704 ms 3.4662 ms 1288257 1037579 984337 8.4125 ms
dlhn 0.1.6 4.9382 ms 6.1385 ms 1279599 1052061 1021161 8.2148 ms
flatbuffers 23.5.26 5.0941 ms 2273740 1408408 1235566 12.660 ms
msgpacker 0.4.3 1.8799 ms 4.5293 ms 1424043 1128758 1110156 9.1850 ms
nachricht-serde 0.4.0 30.378 ms 15.453 ms 1728519 1247642 1233323 11.579 ms
nanoserde 0.1.37 1.2840 ms 2.8091 ms 1770477 1108304 1029947 9.8661 ms
parity-scale-codec 3.6.9 3.0757 ms 3.0292 ms 1288257 1039269 986510 8.3603 ms
postcard 1.0.8 1.7510 ms 3.8126 ms 1279599 1058243 1016738 7.9162 ms
pot 3.0.0 13.359 ms 29.812 ms 2544810 1447453 1268390 15.099 ms
prost 0.12.4 4.9844 ms* 8.8263 ms* 9.4357 ms 1818378 1307777 1266311 11.050 ms
rkyv 0.7.44 1.2757 ms 2.1470 ms* 2.7243 ms* 2029080 1335117 1158855 11.511 ms
rmp-serde 1.1.2 8.7720 ms 11.869 ms 1703813 1231892 1200208 10.836 ms
ron 0.8.1 37.053 ms 91.638 ms 8476284 2181196 1783971 32.218 ms
savefile 0.16.5 985.87 µs 2.5742 ms 1750226 1101682 1027827 9.2557 ms
serde_bare 0.5.0 4.5927 ms 4.3738 ms 1288257 1037597 984356 8.5813 ms
serde_cbor 0.11.2 9.1042 ms 21.163 ms 5878653 1655791 1431560 20.724 ms
serde_json 1.0.115 20.669 ms 29.534 ms 9175594 2334253 1800713 33.173 ms
simd-json 0.13.9 11.183 ms 25.368 ms 9175594 2334253 1800713 31.875 ms
speedy 0.8.7 719.09 µs 2.4865 ms 1546963 1093532 1013443 9.7680 ms
wiring 0.2.1 723.30 µs 2.6283 ms 3500420 2259435 1061377 10.288 ms

Zero-copy deserialization speed

Crate Access Read Update
abomonation 0.7.3 63.493 µs* 64.651 µs*
alkahest 0.1.5 1.8117 ns* 612.40 ns*
capnp 0.18.13 75.400 ns* 699.01 ns*
flatbuffers 23.5.26 2.4096 ns* 5.1318 ms* 2.5657 µs* 5.0959 ms*
rkyv 0.7.44 1.2364 ns* 598.37 µs* 362.48 ns* 596.95 µs* 624.87 ns

Comparison

Relative to best. Higher is better.

Serialize / deserialize speed and size

Crate Serialize Deserialize Size Zlib Zstd Zstd Time
abomonation 0.7.3 100.00% 94.36%* 31.78% 60.93% 65.95% 20.75%
alkahest 0.1.5 67.13% 50.90% 69.47% 69.67% 26.49%
bilrost 0.1007.0 9.75%* 17.56%* 25.92% 56.99% 67.82% 68.86% 26.81%
bincode 2.0.0-rc 69.93% 60.50% 69.11% 78.55% 80.75% 33.42%
bincode 1.3.3 13.36% 55.70% 52.37% 76.87% 81.67% 30.33%
bitcode 0.6.0 67.80% 95.76% 100.00% 100.00% 100.00% 100.00%
borsh 1.3.1 17.28% 76.11% 63.82% 79.21% 82.65% 31.87%
bson 2.9.0 2.27% 5.04% 9.46% 30.26% 52.33% 10.90%
capnp 0.18.13 22.78% 35.60% 56.71% 69.11% 21.27%
cbor4ii 0.3.2 11.40% 12.60% 16.13% 51.78% 58.52% 14.50%
ciborium 0.2.2 2.15% 4.68% 16.13% 51.78% 58.51% 14.60%
databuf 0.5.0 26.93% 61.94% 73.63% 82.63% 85.10% 35.29%
dlhn 0.1.6 9.65% 34.98% 74.12% 81.49% 82.03% 36.14%
flatbuffers 23.5.26 9.36% 41.72% 60.87% 67.80% 23.45%
msgpacker 0.4.3 25.36% 47.40% 66.61% 75.95% 75.45% 32.32%
nachricht-serde 0.4.0 1.57% 13.89% 54.87% 68.72% 67.92% 25.64%
nanoserde 0.1.37 37.13% 76.43% 53.57% 77.35% 81.33% 30.09%
parity-scale-codec 3.6.9 15.50% 70.88% 73.63% 82.49% 84.91% 35.51%
postcard 1.0.8 27.22% 56.31% 74.12% 81.01% 82.39% 37.50%
pot 3.0.0 3.57% 7.20% 37.27% 59.23% 66.04% 19.66%
prost 0.12.4 9.56%* 5.40%* 22.75% 52.16% 65.56% 66.15% 26.87%
rkyv 0.7.44 37.37% 100.00%* 78.81%* 46.75% 64.21% 72.28% 25.79%
rmp-serde 1.1.2 5.43% 18.09% 55.67% 69.59% 69.79% 27.40%
ron 0.8.1 1.29% 2.34% 11.19% 39.31% 46.95% 9.21%
savefile 0.16.5 48.35% 83.40% 54.19% 77.82% 81.50% 32.08%
serde_bare 0.5.0 10.38% 49.09% 73.63% 82.63% 85.10% 34.60%
serde_cbor 0.11.2 5.24% 10.15% 16.13% 51.78% 58.51% 14.33%
serde_json 1.0.115 2.31% 7.27% 10.34% 36.73% 46.52% 8.95%
simd-json 0.13.9 4.26% 8.46% 10.34% 36.73% 46.52% 9.31%
speedy 0.8.7 66.29% 86.35% 61.31% 78.40% 82.65% 30.39%
wiring 0.2.1 65.90% 81.69% 27.10% 37.94% 78.92% 28.86%

Zero-copy deserialization speed

Crate Access Read Update
abomonation 0.7.3 0.00%* 0.56%*
alkahest 0.1.5 68.25%* 59.19%*
capnp 0.18.13 1.64%* 51.86%*
flatbuffers 23.5.26 51.31%* 0.00%* 14.13%* 0.01%*
rkyv 0.7.44 100.00%* 0.00%* 100.00%* 0.06%* 100.00%

Footnotes:

* mouse over for situational details

do not provide deserialization capabilities, but the user can write their own

do not support buffer mutation (capnp and flatbuffers may but not for rust)