Home

Awesome

<!-- AUTOMATICALLY GENERATED, DO NOT EDIT --> <!-- edit README.md.template instead -->

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-11-4 23:36:44

<details><summary>Runtime info</summary>

rustc version

rustc 1.84.0-nightly (b8c8287a2 2024-11-03)
binary: rustc
commit-hash: b8c8287a229cd79604aa84c25e1235fc78cd5f2e
commit-date: 2024-11-03
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.3

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; BHI Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected
</details>

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

CrateSerializeDeserializeSizeZlibZstdZstd Time
bilrost 0.1010.0<span title="encode">698.50 µs*</span> <span title="prepend">626.21 µs*</span>3.2356 ms8746323554463117235.8913 ms
bincode 2.0.0-rc359.43 µs2.4917 ms7412953039442571533.9721 ms
bincode 1.3.3522.18 µs2.4001 ms10457843731273117614.8907 ms
bitcode 0.6.3138.63 µs1.4804 ms7037102888262297552.6015 ms
borsh 1.5.1549.09 µs2.4444 ms8857803622042865144.5678 ms
capnp 0.19.7456.22 µs14432165139864286496.8451 ms
cbor4ii 0.3.3589.35 µs4.8469 ms14078354034403240815.1350 ms
ciborium 0.2.24.1384 ms12.222 ms14078354034403240815.3692 ms
databuf 0.5.0272.64 µs2.0181 ms7657783117152646304.1506 ms
dlhn 0.1.7737.93 µs2.5983 ms7249533014462536293.8284 ms
flatbuffers 24.3.251.0311 ms12763684685393888325.5982 ms
msgpacker 0.4.31.1738 ms2.5810 ms7649963152912648984.1837 ms
nachricht-serde 0.4.05.5531 ms4.2894 ms8186693325562855144.6684 ms
nanoserde 0.1.37266.41 µs2.1014 ms10457843731273117614.5693 ms
parity-scale-codec 3.6.12649.92 µs2.2541 ms7657783117432645184.2027 ms
postcard 1.0.10420.33 µs2.2383 ms7249533023992537473.8453 ms
pot 3.0.12.4472 ms6.7452 ms9719223725133041225.0420 ms
prost 0.13.2<span title="encode">929.05 µs*</span> <span title="populate + encode">2.5967 ms*</span>3.5845 ms8846283631303154945.2597 ms
rkyv 0.8.5264.55 µs<span title="unvalidated">1.6030 ms*</span> <span title="validated upfront with error">2.1723 ms*</span>10114883935263265175.3003 ms
rmp-serde 1.3.01.3123 ms3.3108 ms7849973253842782194.4553 ms
ron 0.8.112.127 ms15.527 ms16074594491583497136.3280 ms
savefile 0.17.7187.21 µs2.1982 ms10458003731403117774.8218 ms
serde-brief 0.1.01.5051 ms5.7323 ms15849464137333414395.3606 ms
serde_bare 0.5.0682.42 µs2.2723 ms7657783117152646303.8662 ms
serde_cbor 0.11.21.9802 ms4.9212 ms14078354034403240814.8718 ms
serde_json 1.0.1284.1119 ms5.4994 ms18274614705603610905.6963 ms
simd-json 0.13.102.1759 ms4.6872 ms18274614705603610905.7182 ms
speedy 0.8.7199.28 µs1.7994 ms8857803622042865144.2354 ms
wiring 0.2.2194.26 µs2.0111 ms10457843379302761883.9686 ms

Zero-copy deserialization speed

CrateAccessReadUpdate
capnp 0.19.7<span title="validated on-demand with error">74.653 ns*</span><span title="validated on-demand with error">169.54 µs*</span>
flatbuffers 24.3.25<span title="unvalidated">2.4798 ns*</span> <span title="validated upfront with error">2.0175 ms*</span><span title="unvalidated">50.286 µs*</span> <span title="validated upfront with error">2.0440 ms*</span>
rkyv 0.8.5<span title="unvalidated">1.2505 ns*</span> <span title="validated upfront with error">570.73 µs*</span><span title="unvalidated">10.581 µs*</span> <span title="validated upfront with error">587.01 µs*</span><span title="unvalidated">7.9317 µs*</span>

Comparison

Relative to best. Higher is better.

Serialize / deserialize speed and size

CrateSerializeDeserializeSizeZlibZstdZstd Time
bilrost 0.1010.0<span title="encode">19.85%*</span> <span title="prepend">22.14%*</span>45.75%80.46%81.26%73.70%44.16%
bincode 2.0.0-rc38.57%59.41%94.93%95.03%89.35%65.49%
bincode 1.3.326.55%61.68%67.29%77.41%73.70%53.19%
bitcode 0.6.3100.00%100.00%100.00%100.00%100.00%100.00%
borsh 1.5.125.25%60.56%79.45%79.74%80.19%56.95%
capnp 0.19.730.39%48.76%56.19%53.60%38.01%
cbor4ii 0.3.323.52%30.54%49.99%71.59%70.89%50.66%
ciborium 0.2.23.35%12.11%49.99%71.59%70.89%48.45%
databuf 0.5.050.85%73.36%91.89%92.66%86.82%62.68%
dlhn 0.1.718.79%56.98%97.07%95.81%90.59%67.95%
flatbuffers 24.3.2513.44%55.13%61.64%59.09%46.47%
msgpacker 0.4.311.81%57.36%91.99%91.61%86.73%62.18%
nachricht-serde 0.4.02.50%34.51%85.96%86.85%80.47%55.73%
nanoserde 0.1.3752.04%70.45%67.29%77.41%73.70%56.93%
parity-scale-codec 3.6.1221.33%65.68%91.89%92.65%86.86%61.90%
postcard 1.0.1032.98%66.14%97.07%95.51%90.54%67.65%
pot 3.0.15.66%21.95%72.40%77.53%75.55%51.60%
prost 0.13.2<span title="encode">14.92%*</span> <span title="populate + encode">5.34%*</span>41.30%79.55%79.54%72.82%49.46%
rkyv 0.8.552.40%<span title="unvalidated">92.35%*</span> <span title="validated upfront with error">68.15%*</span>69.57%73.39%70.37%49.08%
rmp-serde 1.3.010.56%44.71%89.64%88.76%82.58%58.39%
ron 0.8.11.14%9.53%43.78%64.30%65.70%41.11%
savefile 0.17.774.05%67.35%67.29%77.40%73.69%53.95%
serde-brief 0.1.09.21%25.83%44.40%69.81%67.29%48.53%
serde_bare 0.5.020.31%65.15%91.89%92.66%86.82%67.29%
serde_cbor 0.11.27.00%30.08%49.99%71.59%70.89%53.40%
serde_json 1.0.1283.37%26.92%38.51%61.38%63.63%45.67%
simd-json 0.13.106.37%31.58%38.51%61.38%63.63%45.50%
speedy 0.8.769.57%82.27%79.45%79.74%80.19%61.42%
wiring 0.2.271.36%73.61%67.29%85.47%83.19%65.55%

Zero-copy deserialization speed

CrateAccessReadUpdate
capnp 0.19.7<span title="validated on-demand with error">1.68%*</span><span title="validated on-demand with error">6.24%*</span>
flatbuffers 24.3.25<span title="unvalidated">50.43%*</span> <span title="validated upfront with error">0.00%*</span><span title="unvalidated">21.04%*</span> <span title="validated upfront with error">0.52%*</span>
rkyv 0.8.5<span title="unvalidated">100.00%*</span> <span title="validated upfront with error">0.00%*</span><span title="unvalidated">100.00%*</span> <span title="validated upfront with error">1.80%*</span><span title="unvalidated">100.00%*</span>

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

CrateSerializeDeserializeSizeZlibZstdZstd Time
bilrost 0.1010.0<span title="encode">6.6636 ms*</span> <span title="prepend">8.5503 ms*</span>9.1340 ms86250056443961623157272.344 ms
bincode 2.0.0-rc2.8621 ms1.0202 ms6000005537849753458977.7182 ms
bincode 1.3.34.9006 ms5.8036 ms6000008537850053458907.4831 ms
bitcode 0.6.31.4421 ms806.03 µs60000065182295492388012.587 ms
borsh 1.5.16.1241 ms4.1953 ms6000004537849653458897.4386 ms
capnp 0.19.75.3219 ms140000887130367605106278.977 ms
cbor4ii 0.3.310.014 ms48.591 ms131250167524114675796794.723 ms
ciborium 0.2.268.765 ms118.45 ms131223247524660675965891.963 ms
databuf 0.5.02.3983 ms5.2792 ms6000003537849553459007.7154 ms
dlhn 0.1.76.4214 ms6.7573 ms6000003537849553459007.7613 ms
flatbuffers 24.3.25855.42 µs6000024537843453459108.5761 ms
msgpacker 0.4.318.687 ms5.2360 ms7500005605844260143379.9539 ms
nachricht-serde 0.4.0127.28 ms32.854 ms81250376493484638694071.836 ms
nanoserde 0.1.371.3541 ms1.0685 ms6000008537850053458907.7353 ms
parity-scale-codec 3.6.125.0760 ms4.5511 ms6000004537849653458897.6358 ms
postcard 1.0.10507.76 µs1.2025 ms6000003537849553459007.5803 ms
pot 3.0.141.837 ms75.850 ms101223426814618685225191.376 ms
prost 0.13.2<span title="encode">7.7785 ms*</span> <span title="populate + encode">8.9195 ms*</span>13.175 ms87500006665735642187173.689 ms
rkyv 0.8.5238.69 µs<span title="unvalidated">150.11 µs*</span> <span title="validated upfront with error">149.32 µs*</span>6000008537850053458927.5156 ms
rmp-serde 1.3.015.853 ms18.250 ms81250066494876639103771.465 ms
ron 0.8.1174.81 ms237.38 ms2219288589703958138755146.89 ms
savefile 0.17.7244.11 µs245.04 µs6000024537851353458938.1522 ms
serde-brief 0.1.022.878 ms39.662 ms157500158024540681664396.049 ms
serde_bare 0.5.06.1713 ms4.7317 ms6000003537849553459008.0037 ms
serde_cbor 0.11.233.977 ms47.845 ms131223247524660675965898.134 ms
serde_json 1.0.12888.331 ms86.233 ms2619288395660848586741151.81 ms
simd-json 0.13.1053.246 ms73.087 ms2619288395660848586741151.90 ms
speedy 0.8.7238.67 µs585.49 µs6000004537849653458898.1618 ms
wiring 0.2.2149.70 µs319.78 µs6000008537895253458948.5669 ms

Zero-copy deserialization speed

CrateAccessReadUpdate
capnp 0.19.7<span title="validated on-demand with error">105.84 ns*</span><span title="validated on-demand with error">2.1349 ms*</span>
flatbuffers 24.3.25<span title="unvalidated">2.4744 ns*</span> <span title="validated upfront with error">40.100 ns*</span><span title="unvalidated">53.964 µs*</span> <span title="validated upfront with error">77.362 µs*</span>
rkyv 0.8.5<span title="unvalidated">1.2371 ns*</span> <span title="validated upfront with error">5.2754 ns*</span><span title="unvalidated">48.319 µs*</span> <span title="validated upfront with error">38.770 µs*</span><span title="unvalidated">79.354 µs*</span>

Comparison

Relative to best. Higher is better.

Serialize / deserialize speed and size

CrateSerializeDeserializeSizeZlibZstdZstd Time
bilrost 0.1010.0<span title="encode">2.25%*</span> <span title="prepend">1.75%*</span>1.63%69.57%80.42%79.02%10.28%
bincode 2.0.0-rc5.23%14.64%100.00%96.35%92.11%96.38%
bincode 1.3.33.05%2.57%100.00%96.35%92.11%99.41%
bitcode 0.6.310.38%18.53%100.00%100.00%100.00%59.10%
borsh 1.5.12.44%3.56%100.00%96.35%92.11%100.00%
capnp 0.19.72.81%42.86%72.68%81.37%9.42%
cbor4ii 0.3.31.49%0.31%45.71%68.88%72.86%7.85%
ciborium 0.2.20.22%0.13%45.72%68.87%72.84%8.09%
databuf 0.5.06.24%2.83%100.00%96.35%92.11%96.41%
dlhn 0.1.72.33%2.21%100.00%96.35%92.11%95.84%
flatbuffers 24.3.2517.50%100.00%96.35%92.11%86.74%
msgpacker 0.4.30.80%2.85%80.00%85.54%81.87%74.73%
nachricht-serde 0.4.00.12%0.45%73.85%79.81%77.09%10.35%
nanoserde 0.1.3711.06%13.97%100.00%96.35%92.11%96.16%
parity-scale-codec 3.6.122.95%3.28%100.00%96.35%92.11%97.42%
postcard 1.0.1029.48%12.42%100.00%96.35%92.11%98.13%
pot 3.0.10.36%0.20%59.27%76.05%71.86%8.14%
prost 0.13.2<span title="encode">1.92%*</span> <span title="populate + encode">1.68%*</span>1.13%68.57%77.75%76.67%10.09%
rkyv 0.8.562.72%<span title="unvalidated">99.47%*</span> <span title="validated upfront with error">100.00%*</span>100.00%96.35%92.11%98.98%
rmp-serde 1.3.00.94%0.82%73.85%79.79%77.04%10.41%
ron 0.8.10.09%0.06%27.04%57.77%60.50%5.06%
savefile 0.17.761.32%60.94%100.00%96.35%92.11%91.25%
serde-brief 0.1.00.65%0.38%38.10%64.58%72.23%7.74%
serde_bare 0.5.02.43%3.16%100.00%96.35%92.11%92.94%
serde_cbor 0.11.20.44%0.31%45.72%68.87%72.84%7.58%
serde_json 1.0.1280.17%0.17%22.91%54.17%57.34%4.90%
simd-json 0.13.100.28%0.20%22.91%54.17%57.34%4.90%
speedy 0.8.762.72%25.50%100.00%96.35%92.11%91.14%
wiring 0.2.2100.00%46.69%100.00%96.34%92.11%86.83%

Zero-copy deserialization speed

CrateAccessReadUpdate
capnp 0.19.7<span title="validated on-demand with error">1.17%*</span><span title="validated on-demand with error">1.82%*</span>
flatbuffers 24.3.25<span title="unvalidated">50.00%*</span> <span title="validated upfront with error">3.09%*</span><span title="unvalidated">71.84%*</span> <span title="validated upfront with error">50.12%*</span>
rkyv 0.8.5<span title="unvalidated">100.00%*</span> <span title="validated upfront with error">23.45%*</span><span title="unvalidated">80.24%*</span> <span title="validated upfront with error">100.00%*</span><span title="unvalidated">100.00%*</span>

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

CrateSerializeDeserializeSizeZlibZstdZstd Time
bilrost 0.1010.0<span title="encode">956.15 µs*</span> <span title="prepend">846.30 µs*</span>3.2173 ms4893482811732495463.0684 ms
bincode 2.0.0-rc332.51 µs2.1307 ms3674132212912062732.5057 ms
bincode 1.3.3590.20 µs1.8495 ms5699752405252324232.8948 ms
bitcode 0.6.3132.64 µs1.2660 ms327688200947182736762.32 µs
borsh 1.5.1549.87 µs1.8444 ms4465952342362100082.4694 ms
capnp 0.19.7462.49 µs8038963356062808513.9281 ms
cbor4ii 0.3.3784.17 µs4.6461 ms11098313447452745143.8443 ms
ciborium 0.2.23.7028 ms10.397 ms11098213447512745263.8450 ms
databuf 0.5.0326.68 µs1.7623 ms3563112130621984882.3799 ms
dlhn 0.1.7805.07 µs2.6167 ms3664962206002056832.4958 ms
flatbuffers 24.3.253.3027 ms8441683456962940153.9107 ms
msgpacker 0.4.3917.07 µs2.8234 ms3912512368772204762.6238 ms
nachricht-serde 0.4.05.3496 ms3.9511 ms4497452524322311102.8342 ms
nanoserde 0.1.37308.54 µs1.8994 ms5679752399302324192.8804 ms
parity-scale-codec 3.6.12600.16 µs1.9765 ms3563112129761985242.3963 ms
postcard 1.0.10443.62 µs1.9896 ms3674892219132073442.4758 ms
pot 3.0.12.4611 ms6.0389 ms5991252991582476933.1764 ms
prost 0.13.2<span title="encode">1.2450 ms*</span> <span title="populate + encode">2.9574 ms*</span>3.5215 ms5968113053192693103.4703 ms
rkyv 0.8.5337.18 µs<span title="unvalidated">1.5118 ms*</span> <span title="validated upfront with error">2.0260 ms*</span>6037762547762200872.7852 ms
rmp-serde 1.3.01.4308 ms3.0412 ms4245332452142261882.6972 ms
ron 0.8.17.1032 ms16.341 ms14652234349353433385.9049 ms
savefile 0.17.7211.67 µs1.8514 ms5669912393612320132.8855 ms
serde-brief 0.1.01.3659 ms5.2834 ms12760143738982936794.0709 ms
serde_bare 0.5.0747.89 µs2.3256 ms3563112130621984882.3908 ms
serde_cbor 0.11.21.8585 ms4.6814 ms11098213447512745263.8568 ms
serde_json 1.0.1283.9913 ms6.4631 ms16231914665273596236.0955 ms
simd-json 0.13.102.2427 ms4.5292 ms16231914665273596236.0373 ms
speedy 0.8.7281.61 µs1.6044 ms4495952349702103612.4787 ms
wiring 0.2.2221.12 µs1.8093 ms5669752478102252592.8966 ms

Zero-copy deserialization speed

CrateAccessReadUpdate
capnp 0.19.7<span title="validated on-demand with error">74.556 ns*</span><span title="validated on-demand with error">420.03 ns*</span>
flatbuffers 24.3.25<span title="unvalidated">2.4741 ns*</span> <span title="validated upfront with error">2.2245 ms*</span><span title="unvalidated">1.3562 µs*</span> <span title="validated upfront with error">2.4888 ms*</span>
rkyv 0.8.5<span title="unvalidated">1.2374 ns*</span> <span title="validated upfront with error">511.42 µs*</span><span title="unvalidated">239.62 ns*</span> <span title="validated upfront with error">500.70 µs*</span><span title="unvalidated">716.06 ns*</span>

Comparison

Relative to best. Higher is better.

Serialize / deserialize speed and size

CrateSerializeDeserializeSizeZlibZstdZstd Time
bilrost 0.1010.0<span title="encode">13.87%*</span> <span title="prepend">15.67%*</span>39.35%66.96%71.47%73.23%24.84%
bincode 2.0.0-rc39.89%59.42%89.19%90.81%88.59%30.42%
bincode 1.3.322.47%68.45%57.49%83.55%78.62%26.33%
bitcode 0.6.3100.00%100.00%100.00%100.00%100.00%100.00%
borsh 1.5.124.12%68.64%73.37%85.79%87.01%30.87%
capnp 0.19.728.68%40.76%59.88%65.07%19.41%
cbor4ii 0.3.316.91%27.25%29.53%58.29%66.57%19.83%
ciborium 0.2.23.58%12.18%29.53%58.29%66.56%19.83%
databuf 0.5.040.60%71.84%91.97%94.31%92.06%32.03%
dlhn 0.1.716.48%48.38%89.41%91.09%88.84%30.54%
flatbuffers 24.3.254.02%38.82%58.13%62.15%19.49%
msgpacker 0.4.314.46%44.84%83.75%84.83%82.88%29.05%
nachricht-serde 0.4.02.48%32.04%72.86%79.60%79.07%26.90%
nanoserde 0.1.3742.99%66.65%57.69%83.75%78.62%26.47%
parity-scale-codec 3.6.1222.10%64.05%91.97%94.35%92.05%31.81%
postcard 1.0.1029.90%63.63%89.17%90.55%88.13%30.79%
pot 3.0.15.39%20.96%54.69%67.17%73.78%24.00%
prost 0.13.2<span title="encode">10.65%*</span> <span title="populate + encode">4.49%*</span>35.95%54.91%65.82%67.85%21.97%
rkyv 0.8.539.34%<span title="unvalidated">83.74%*</span> <span title="validated upfront with error">62.49%*</span>54.27%78.87%83.03%27.37%
rmp-serde 1.3.09.27%41.63%77.19%81.95%80.79%28.26%
ron 0.8.11.87%7.75%22.36%46.20%53.22%12.91%
savefile 0.17.762.66%68.38%57.79%83.95%78.76%26.42%
serde-brief 0.1.09.71%23.96%25.68%53.74%62.22%18.73%
serde_bare 0.5.017.74%54.44%91.97%94.31%92.06%31.89%
serde_cbor 0.11.27.14%27.04%29.53%58.29%66.56%19.77%
serde_json 1.0.1283.32%19.59%20.19%43.07%50.81%12.51%
simd-json 0.13.105.91%27.95%20.19%43.07%50.81%12.63%
speedy 0.8.747.10%78.91%72.89%85.52%86.87%30.75%
wiring 0.2.259.99%69.97%57.80%81.09%81.12%26.32%

Zero-copy deserialization speed

CrateAccessReadUpdate
capnp 0.19.7<span title="validated on-demand with error">1.66%*</span><span title="validated on-demand with error">57.05%*</span>
flatbuffers 24.3.25<span title="unvalidated">50.01%*</span> <span title="validated upfront with error">0.00%*</span><span title="unvalidated">17.67%*</span> <span title="validated upfront with error">0.01%*</span>
rkyv 0.8.5<span title="unvalidated">100.00%*</span> <span title="validated upfront with error">0.00%*</span><span title="unvalidated">100.00%*</span> <span title="validated upfront with error">0.05%*</span><span title="unvalidated">100.00%*</span>

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

CrateSerializeDeserializeSizeZlibZstdZstd Time
bilrost 0.1010.0<span title="encode">4.4452 ms*</span> <span title="prepend">2.4551 ms*</span>8.5307 ms16644281264167121647210.994 ms
bincode 2.0.0-rc1.4224 ms3.6393 ms1372381109148610372968.8427 ms
bincode 1.3.33.7645 ms4.2802 ms1811011111528110256279.7781 ms
bitcode 0.6.3703.53 µs2.3197 ms9484998573218376583.1612 ms
borsh 1.5.12.8129 ms2.8549 ms1486162108235710135509.5717 ms
capnp 0.19.72.1674 ms26640401511895121208713.806 ms
cbor4ii 0.3.33.2351 ms17.439 ms58787911655835143139020.591 ms
ciborium 0.2.223.372 ms54.463 ms58786531655791143156020.724 ms
databuf 0.5.01.2707 ms3.7162 ms128825710375799843378.4515 ms
dlhn 0.1.74.8860 ms7.5668 ms1279599105206110211618.1009 ms
flatbuffers 24.3.255.2771 ms22737401408408123556612.658 ms
msgpacker 0.4.32.7729 ms6.6024 ms1424043112875811101569.4264 ms
nachricht-serde 0.4.029.813 ms17.514 ms17285191247642123332311.561 ms
nanoserde 0.1.371.2295 ms2.9181 ms17704771108304102994710.014 ms
parity-scale-codec 3.6.122.8216 ms3.1301 ms128825710392699865108.5630 ms
postcard 1.0.101.9181 ms4.2494 ms1279599105824310167388.2941 ms
pot 3.0.113.900 ms29.841 ms25448101447453126839015.080 ms
prost 0.13.2<span title="encode">5.2813 ms*</span> <span title="populate + encode">9.1632 ms*</span>8.4194 ms18183781307777126631111.648 ms
rkyv 0.8.51.0203 ms<span title="unvalidated">2.1646 ms*</span> <span title="validated upfront with error">2.5860 ms*</span>20290801351984118399012.265 ms
rmp-serde 1.3.010.064 ms10.940 ms17038131231892120020810.874 ms
ron 0.8.136.014 ms89.821 ms84762842181196178397133.458 ms
savefile 0.17.7809.12 µs2.7223 ms17502261101682102782810.027 ms
serde-brief 0.1.06.6090 ms21.259 ms67969491754624153322322.717 ms
serde_bare 0.5.04.7388 ms4.7526 ms128825710375979843568.5428 ms
serde_cbor 0.11.29.6980 ms20.936 ms58786531655791143156020.501 ms
serde_json 1.0.12821.736 ms29.690 ms91755942334253180071333.383 ms
simd-json 0.13.1011.644 ms26.770 ms91755942334253180071333.486 ms
speedy 0.8.7710.74 µs2.4039 ms1546963109353210134439.7296 ms
wiring 0.2.2695.66 µs2.7367 ms17502101129857105890610.393 ms

Zero-copy deserialization speed

CrateAccessReadUpdate
capnp 0.19.7<span title="validated on-demand with error">74.606 ns*</span><span title="validated on-demand with error">712.85 ns*</span>
flatbuffers 24.3.25<span title="unvalidated">2.4743 ns*</span> <span title="validated upfront with error">4.6570 ms*</span><span title="unvalidated">2.6279 µs*</span> <span title="validated upfront with error">4.8984 ms*</span>
rkyv 0.8.5<span title="unvalidated">1.2369 ns*</span> <span title="validated upfront with error">434.66 µs*</span><span title="unvalidated">433.46 ns*</span> <span title="validated upfront with error">437.38 µs*</span><span title="unvalidated">234.17 ns*</span>

Comparison

Relative to best. Higher is better.

Serialize / deserialize speed and size

CrateSerializeDeserializeSizeZlibZstdZstd Time
bilrost 0.1010.0<span title="encode">15.65%*</span> <span title="prepend">28.34%*</span>25.37%56.99%67.82%68.86%28.75%
bincode 2.0.0-rc48.91%59.48%69.11%78.55%80.75%35.75%
bincode 1.3.318.48%50.57%52.37%76.87%81.67%32.33%
bitcode 0.6.398.88%93.31%100.00%100.00%100.00%100.00%
borsh 1.5.124.73%75.82%63.82%79.21%82.65%33.03%
capnp 0.19.732.10%35.60%56.71%69.11%22.90%
cbor4ii 0.3.321.50%12.41%16.13%51.78%58.52%15.35%
ciborium 0.2.22.98%3.97%16.13%51.78%58.51%15.25%
databuf 0.5.054.75%58.25%73.63%82.63%85.10%37.40%
dlhn 0.1.714.24%28.61%74.12%81.49%82.03%39.02%
flatbuffers 24.3.2513.18%41.72%60.87%67.80%24.97%
msgpacker 0.4.325.09%32.79%66.61%75.95%75.45%33.54%
nachricht-serde 0.4.02.33%12.36%54.87%68.72%67.92%27.34%
nanoserde 0.1.3756.58%74.18%53.57%77.35%81.33%31.57%
parity-scale-codec 3.6.1224.65%69.15%73.63%82.49%84.91%36.92%
postcard 1.0.1036.27%50.94%74.12%81.01%82.39%38.11%
pot 3.0.15.00%7.25%37.27%59.23%66.04%20.96%
prost 0.13.2<span title="encode">13.17%*</span> <span title="populate + encode">7.59%*</span>25.71%52.16%65.56%66.15%27.14%
rkyv 0.8.568.18%<span title="unvalidated">100.00%*</span> <span title="validated upfront with error">83.70%*</span>46.75%63.41%70.75%25.77%
rmp-serde 1.3.06.91%19.79%55.67%69.59%69.79%29.07%
ron 0.8.11.93%2.41%11.19%39.31%46.95%9.45%
savefile 0.17.785.98%79.51%54.19%77.82%81.50%31.53%
serde-brief 0.1.010.53%10.18%13.95%48.86%54.63%13.92%
serde_bare 0.5.014.68%45.55%73.63%82.63%85.10%37.00%
serde_cbor 0.11.27.17%10.34%16.13%51.78%58.51%15.42%
serde_json 1.0.1283.20%7.29%10.34%36.73%46.52%9.47%
simd-json 0.13.105.97%8.09%10.34%36.73%46.52%9.44%
speedy 0.8.797.88%90.05%61.31%78.40%82.65%32.49%
wiring 0.2.2100.00%79.10%54.19%75.88%79.11%30.42%

Zero-copy deserialization speed

CrateAccessReadUpdate
capnp 0.19.7<span title="validated on-demand with error">1.66%*</span><span title="validated on-demand with error">60.81%*</span>
flatbuffers 24.3.25<span title="unvalidated">49.99%*</span> <span title="validated upfront with error">0.00%*</span><span title="unvalidated">16.49%*</span> <span title="validated upfront with error">0.01%*</span>
rkyv 0.8.5<span title="unvalidated">100.00%*</span> <span title="validated upfront with error">0.00%*</span><span title="unvalidated">100.00%*</span> <span title="validated upfront with error">0.10%*</span><span title="unvalidated">100.00%*</span>

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)