musli

Benchmarks and size comparisons

The following are the results of preliminary benchmarking and should be taken with a big grain of 🧂.

Identifiers which are used in tests:

The following are one section for each kind of benchmark we perform. They range from “Full features” to more specialized ones like zerocopy comparisons.

Below you’ll also find size comparisons.

Full features

These frameworks provide a fair comparison against Müsli on various areas since they support the same set of features in what types of data they can represent.

More:

full/dec/primitives
Report 📓
Group Mean Interval Link
dec/primitives/musli_descriptive 987.35ns ± 0.74ns 986.10ns — 988.98ns Report 📓
dec/primitives/musli_storage 427.30ns ± 0.42ns 426.54ns — 428.18ns Report 📓
dec/primitives/musli_storage_packed 93.11ns ± 0.09ns 92.95ns — 93.29ns Report 📓
dec/primitives/musli_value1 395.31ns ± 0.28ns 394.86ns — 395.96ns Report 📓
dec/primitives/musli_wire 810.74ns ± 0.57ns 809.76ns — 811.98ns Report 📓
dec/primitives/postcard 256.20ns ± 0.18ns 255.91ns — 256.59ns Report 📓
dec/primitives/serde_bincode 80.02ns ± 0.08ns 79.87ns — 80.19ns Report 📓
dec/primitives/serde_bitcode 1.29μs ± 0.97ns 1.29μs — 1.29μs Report 📓
dec/primitives/serde_rmp 327.66ns ± 0.22ns 327.30ns — 328.16ns Report 📓
full/enc/primitives
Report 📓
Group Mean Interval Link
enc/primitives/musli_descriptive 866.52ns ± 1.03ns 864.93ns — 868.87ns Report 📓
enc/primitives/musli_storage 291.75ns ± 0.25ns 291.31ns — 292.30ns Report 📓
enc/primitives/musli_storage_packed 132.40ns ± 0.08ns 132.27ns — 132.58ns Report 📓
enc/primitives/musli_value1 1.03μs ± 0.75ns 1.03μs — 1.03μs Report 📓
enc/primitives/musli_wire 764.95ns ± 0.72ns 763.71ns — 766.52ns Report 📓
enc/primitives/postcard 434.49ns ± 0.27ns 434.06ns — 435.10ns Report 📓
enc/primitives/serde_bincode 104.56ns ± 0.11ns 104.42ns — 104.80ns Report 📓
enc/primitives/serde_bitcode 4.15μs ± 4.90ns 4.15μs — 4.17μs Report 📓
enc/primitives/serde_rmp 226.29ns ± 0.20ns 225.93ns — 226.72ns Report 📓
full/dec/primpacked
Report 📓
Group Mean Interval Link
dec/primpacked/musli_descriptive 976.04ns ± 0.71ns 974.85ns — 977.60ns Report 📓
dec/primpacked/musli_storage 488.79ns ± 0.66ns 487.62ns — 490.19ns Report 📓
dec/primpacked/musli_storage_packed 488.54ns ± 0.42ns 487.79ns — 489.44ns Report 📓
dec/primpacked/musli_value1 462.10ns ± 0.34ns 461.60ns — 462.87ns Report 📓
dec/primpacked/musli_wire 829.16ns ± 0.62ns 828.10ns — 830.53ns Report 📓
dec/primpacked/postcard 249.88ns ± 0.16ns 249.63ns — 250.23ns Report 📓
dec/primpacked/serde_bincode 59.13ns ± 0.05ns 59.06ns — 59.23ns Report 📓
dec/primpacked/serde_bitcode 1.55μs ± 1.25ns 1.55μs — 1.56μs Report 📓
dec/primpacked/serde_rmp 427.54ns ± 0.32ns 427.00ns — 428.26ns Report 📓
full/enc/primpacked
Report 📓
Group Mean Interval Link
enc/primpacked/musli_descriptive 872.05ns ± 0.72ns 870.77ns — 873.57ns Report 📓
enc/primpacked/musli_storage 231.91ns ± 0.25ns 231.58ns — 232.47ns Report 📓
enc/primpacked/musli_storage_packed 232.07ns ± 0.17ns 231.77ns — 232.44ns Report 📓
enc/primpacked/musli_value1 1.45μs ± 1.24ns 1.45μs — 1.45μs Report 📓
enc/primpacked/musli_wire 737.05ns ± 0.77ns 735.59ns — 738.61ns Report 📓
enc/primpacked/postcard 425.08ns ± 0.49ns 424.33ns — 426.20ns Report 📓
enc/primpacked/serde_bincode 124.58ns ± 0.09ns 124.43ns — 124.78ns Report 📓
enc/primpacked/serde_bitcode 4.67μs ± 6.05ns 4.66μs — 4.68μs Report 📓
enc/primpacked/serde_rmp 253.75ns ± 0.19ns 253.44ns — 254.15ns Report 📓
full/dec/medium_enum
Report 📓
Group Mean Interval Link
dec/medium_enum/musli_descriptive 2.27μs ± 2.72ns 2.27μs — 2.28μs Report 📓
dec/medium_enum/musli_storage 1.18μs ± 1.06ns 1.18μs — 1.18μs Report 📓
dec/medium_enum/musli_storage_packed 841.56ns ± 0.53ns 840.65ns — 842.71ns Report 📓
dec/medium_enum/musli_value1 1.02μs ± 0.78ns 1.02μs — 1.02μs Report 📓
dec/medium_enum/musli_wire 1.84μs ± 1.72ns 1.83μs — 1.84μs Report 📓
dec/medium_enum/postcard 1.19μs ± 0.93ns 1.19μs — 1.20μs Report 📓
dec/medium_enum/serde_bincode 865.94ns ± 0.75ns 864.81ns — 867.64ns Report 📓
dec/medium_enum/serde_bitcode 9.19μs ± 7.68ns 9.18μs — 9.21μs Report 📓
dec/medium_enum/serde_rmp 2.40μs ± 2.60ns 2.39μs — 2.40μs Report 📓
full/enc/medium_enum
Report 📓
Group Mean Interval Link
enc/medium_enum/musli_descriptive 1.59μs ± 1.24ns 1.59μs — 1.59μs Report 📓
enc/medium_enum/musli_storage 666.40ns ± 0.71ns 665.16ns — 667.91ns Report 📓
enc/medium_enum/musli_storage_packed 500.13ns ± 0.37ns 499.53ns — 500.96ns Report 📓
enc/medium_enum/musli_value1 3.21μs ± 2.95ns 3.21μs — 3.22μs Report 📓
enc/medium_enum/musli_wire 1.40μs ± 1.07ns 1.40μs — 1.40μs Report 📓
enc/medium_enum/postcard 915.61ns ± 0.94ns 913.87ns — 917.55ns Report 📓
enc/medium_enum/serde_bincode 297.82ns ± 0.23ns 297.50ns — 298.35ns Report 📓
enc/medium_enum/serde_bitcode 13.53μs ± 10.26ns 13.51μs — 13.55μs Report 📓
enc/medium_enum/serde_rmp 753.63ns ± 1.12ns 751.53ns — 755.91ns Report 📓
full/dec/large
Report 📓
Group Mean Interval Link
dec/large/musli_descriptive 273.87μs ± 257.28ns 273.45μs — 274.45μs Report 📓
dec/large/musli_storage 88.65μs ± 75.53ns 88.55μs — 88.83μs Report 📓
dec/large/musli_storage_packed 46.60μs ± 54.82ns 46.51μs — 46.72μs Report 📓
dec/large/musli_value1 118.19μs ± 354.91ns 117.56μs — 118.95μs Report 📓
dec/large/musli_wire 258.39μs ± 323.17ns 257.94μs — 259.12μs Report 📓
dec/large/postcard 86.72μs ± 120.57ns 86.53μs — 86.99μs Report 📓
dec/large/serde_bincode 59.81μs ± 60.72ns 59.72μs — 59.95μs Report 📓
dec/large/serde_bitcode 98.32μs ± 127.63ns 98.08μs — 98.58μs Report 📓
dec/large/serde_rmp 231.02μs ± 307.99ns 230.55μs — 231.73μs Report 📓
full/enc/large
Report 📓
Group Mean Interval Link
enc/large/musli_descriptive 187.44μs ± 193.82ns 187.14μs — 187.88μs Report 📓
enc/large/musli_storage 63.99μs ± 52.61ns 63.89μs — 64.10μs Report 📓
enc/large/musli_storage_packed 29.66μs ± 19.29ns 29.63μs — 29.70μs Report 📓
enc/large/musli_value1 709.06μs ± 1.10μs 707.52μs — 711.56μs Report 📓
enc/large/musli_wire 159.80μs ± 145.78ns 159.58μs — 160.14μs Report 📓
enc/large/postcard 112.61μs ± 234.80ns 112.23μs — 113.14μs Report 📓
enc/large/serde_bincode 40.23μs ± 32.08ns 40.18μs — 40.30μs Report 📓
enc/large/serde_bitcode 117.70μs ± 98.32ns 117.54μs — 117.92μs Report 📓
enc/large/serde_rmp 128.16μs ± 153.02ns 127.92μs — 128.51μs Report 📓
full/dec/allocated
Report 📓
Group Mean Interval Link
dec/allocated/musli_descriptive 3.48μs ± 3.35ns 3.47μs — 3.48μs Report 📓
dec/allocated/musli_storage 3.05μs ± 3.79ns 3.04μs — 3.06μs Report 📓
dec/allocated/musli_storage_packed 2.57μs ± 2.33ns 2.57μs — 2.58μs Report 📓
dec/allocated/musli_value1 2.17μs ± 2.14ns 2.17μs — 2.18μs Report 📓
dec/allocated/musli_wire 3.67μs ± 4.11ns 3.66μs — 3.68μs Report 📓
dec/allocated/postcard 3.42μs ± 3.74ns 3.41μs — 3.43μs Report 📓
dec/allocated/serde_bincode 3.18μs ± 4.51ns 3.17μs — 3.19μs Report 📓
dec/allocated/serde_bitcode 5.72μs ± 5.55ns 5.71μs — 5.73μs Report 📓
dec/allocated/serde_rmp 4.34μs ± 3.55ns 4.33μs — 4.34μs Report 📓
full/enc/allocated
Report 📓
Group Mean Interval Link
enc/allocated/musli_descriptive 823.57ns ± 0.58ns 822.66ns — 824.86ns Report 📓
enc/allocated/musli_storage 396.47ns ± 0.41ns 395.83ns — 397.40ns Report 📓
enc/allocated/musli_storage_packed 320.81ns ± 0.27ns 320.36ns — 321.40ns Report 📓
enc/allocated/musli_value1 2.38μs ± 2.35ns 2.38μs — 2.39μs Report 📓
enc/allocated/musli_wire 756.17ns ± 0.62ns 755.01ns — 757.46ns Report 📓
enc/allocated/postcard 1.21μs ± 1.09ns 1.20μs — 1.21μs Report 📓
enc/allocated/serde_bincode 315.46ns ± 0.65ns 314.43ns — 316.92ns Report 📓
enc/allocated/serde_bitcode 8.23μs ± 7.18ns 8.21μs — 8.24μs Report 📓
enc/allocated/serde_rmp 764.84ns ± 0.58ns 763.86ns — 766.12ns Report 📓

Text-based formats

These are text-based formats, which support the full feature set of this test suite.

More:

text/dec/primitives
Report 📓
Group Mean Interval Link
dec/primitives/musli_json 3.24μs ± 2.66ns 3.24μs — 3.25μs Report 📓
dec/primitives/serde_json 4.50μs ± 4.03ns 4.49μs — 4.51μs Report 📓
text/enc/primitives
Report 📓
Group Mean Interval Link
enc/primitives/musli_json 761.75ns ± 0.60ns 760.85ns — 763.12ns Report 📓
enc/primitives/serde_json 1.30μs ± 1.56ns 1.30μs — 1.31μs Report 📓
text/dec/primpacked
Report 📓
Group Mean Interval Link
dec/primpacked/musli_json 3.95μs ± 3.58ns 3.94μs — 3.95μs Report 📓
dec/primpacked/serde_json 4.72μs ± 5.13ns 4.71μs — 4.73μs Report 📓
text/enc/primpacked
Report 📓
Group Mean Interval Link
enc/primpacked/musli_json 828.99ns ± 0.74ns 827.78ns — 830.62ns Report 📓
enc/primpacked/serde_json 1.39μs ± 1.19ns 1.39μs — 1.39μs Report 📓
text/dec/medium_enum
Report 📓
Group Mean Interval Link
dec/medium_enum/musli_json 8.73μs ± 12.07ns 8.71μs — 8.76μs Report 📓
dec/medium_enum/serde_json 8.64μs ± 7.01ns 8.63μs — 8.66μs Report 📓
text/enc/medium_enum
Report 📓
Group Mean Interval Link
enc/medium_enum/musli_json 1.86μs ± 1.70ns 1.85μs — 1.86μs Report 📓
enc/medium_enum/serde_json 2.59μs ± 2.25ns 2.58μs — 2.59μs Report 📓
text/dec/large
Report 📓
Group Mean Interval Link
dec/large/musli_json 1.01ms ± 1.19μs 1.01ms — 1.01ms Report 📓
dec/large/serde_json 758.72μs ± 593.30ns 757.82μs — 760.06μs Report 📓
text/enc/large
Report 📓
Group Mean Interval Link
enc/large/musli_json 246.15μs ± 188.86ns 245.89μs — 246.59μs Report 📓
enc/large/serde_json 305.17μs ± 389.84ns 304.58μs — 306.06μs Report 📓
text/dec/allocated
Report 📓
Group Mean Interval Link
dec/allocated/musli_json 9.27μs ± 10.87ns 9.25μs — 9.29μs Report 📓
dec/allocated/serde_json 8.71μs ± 8.51ns 8.70μs — 8.73μs Report 📓
text/enc/allocated
Report 📓
Group Mean Interval Link
enc/allocated/musli_json 2.28μs ± 1.91ns 2.28μs — 2.29μs Report 📓
enc/allocated/serde_json 2.53μs ± 2.29ns 2.52μs — 2.53μs Report 📓

Fewer features

Missing features:

This is a suite where support for 128-bit integers and maps are disabled. Usually because the underlying framework lacks support for them.

More:

fewer/dec/primitives
Report 📓
Group Mean Interval Link
dec/primitives/musli_descriptive 778.81ns ± 0.67ns 777.64ns — 780.25ns Report 📓
dec/primitives/musli_storage 374.55ns ± 0.56ns 373.66ns — 375.83ns Report 📓
dec/primitives/musli_storage_packed 88.33ns ± 0.07ns 88.19ns — 88.47ns Report 📓
dec/primitives/musli_value1 347.65ns ± 0.57ns 346.54ns — 348.78ns Report 📓
dec/primitives/musli_wire 671.31ns ± 0.50ns 670.48ns — 672.42ns Report 📓
dec/primitives/serde_cbor 1.53μs ± 3.86ns 1.53μs — 1.54μs Report 📓
fewer/enc/primitives
Report 📓
Group Mean Interval Link
enc/primitives/musli_descriptive 547.55ns ± 0.59ns 546.43ns — 548.75ns Report 📓
enc/primitives/musli_storage 261.35ns ± 0.29ns 260.93ns — 262.01ns Report 📓
enc/primitives/musli_storage_packed 124.50ns ± 0.10ns 124.33ns — 124.72ns Report 📓
enc/primitives/musli_value1 1.02μs ± 0.90ns 1.02μs — 1.02μs Report 📓
enc/primitives/musli_wire 420.67ns ± 0.41ns 419.91ns — 421.52ns Report 📓
enc/primitives/serde_cbor 415.63ns ± 0.47ns 414.99ns — 416.70ns Report 📓
fewer/dec/primpacked
Report 📓
Group Mean Interval Link
dec/primpacked/musli_descriptive 801.35ns ± 0.52ns 800.50ns — 802.51ns Report 📓
dec/primpacked/musli_storage 399.25ns ± 0.37ns 398.60ns — 400.03ns Report 📓
dec/primpacked/musli_storage_packed 399.02ns ± 0.33ns 398.48ns — 399.74ns Report 📓
dec/primpacked/musli_value1 398.20ns ± 0.29ns 397.71ns — 398.85ns Report 📓
dec/primpacked/musli_wire 721.90ns ± 0.54ns 721.06ns — 723.13ns Report 📓
dec/primpacked/serde_cbor 1.67μs ± 3.22ns 1.66μs — 1.68μs Report 📓
fewer/enc/primpacked
Report 📓
Group Mean Interval Link
enc/primpacked/musli_descriptive 549.02ns ± 0.58ns 547.92ns — 550.21ns Report 📓
enc/primpacked/musli_storage 216.38ns ± 0.15ns 216.14ns — 216.71ns Report 📓
enc/primpacked/musli_storage_packed 216.29ns ± 0.15ns 216.05ns — 216.62ns Report 📓
enc/primpacked/musli_value1 1.22μs ± 0.90ns 1.22μs — 1.22μs Report 📓
enc/primpacked/musli_wire 432.28ns ± 0.39ns 431.59ns — 433.10ns Report 📓
enc/primpacked/serde_cbor 484.65ns ± 0.56ns 483.65ns — 485.82ns Report 📓
fewer/dec/medium_enum
Report 📓
Group Mean Interval Link
dec/medium_enum/musli_descriptive 2.00μs ± 2.22ns 2.00μs — 2.01μs Report 📓
dec/medium_enum/musli_storage 1.11μs ± 0.69ns 1.11μs — 1.11μs Report 📓
dec/medium_enum/musli_storage_packed 852.11ns ± 0.62ns 851.08ns — 853.50ns Report 📓
dec/medium_enum/musli_value1 969.51ns ± 1.11ns 967.62ns — 971.91ns Report 📓
dec/medium_enum/musli_wire 1.63μs ± 1.33ns 1.62μs — 1.63μs Report 📓
dec/medium_enum/serde_cbor 4.22μs ± 5.06ns 4.21μs — 4.23μs Report 📓
fewer/enc/medium_enum
Report 📓
Group Mean Interval Link
enc/medium_enum/musli_descriptive 1.29μs ± 1.07ns 1.29μs — 1.30μs Report 📓
enc/medium_enum/musli_storage 650.10ns ± 0.88ns 648.84ns — 652.10ns Report 📓
enc/medium_enum/musli_storage_packed 510.84ns ± 0.51ns 509.92ns — 511.90ns Report 📓
enc/medium_enum/musli_value1 3.21μs ± 2.99ns 3.21μs — 3.22μs Report 📓
enc/medium_enum/musli_wire 1.05μs ± 0.89ns 1.05μs — 1.05μs Report 📓
enc/medium_enum/serde_cbor 975.60ns ± 1.35ns 973.36ns — 978.58ns Report 📓
fewer/dec/large
Report 📓
Group Mean Interval Link
dec/large/musli_descriptive 302.12μs ± 150.58ns 301.87μs — 302.45μs Report 📓
dec/large/musli_storage 97.67μs ± 69.94ns 97.55μs — 97.82μs Report 📓
dec/large/musli_storage_packed 39.70μs ± 28.08ns 39.65μs — 39.76μs Report 📓
dec/large/musli_value1 129.57μs ± 377.29ns 128.94μs — 130.41μs Report 📓
dec/large/musli_wire 273.02μs ± 246.72ns 272.58μs — 273.54μs Report 📓
dec/large/serde_cbor 500.50μs ± 813.65ns 499.32μs — 502.37μs Report 📓
fewer/enc/large
Report 📓
Group Mean Interval Link
enc/large/musli_descriptive 204.66μs ± 181.63ns 204.40μs — 205.08μs Report 📓
enc/large/musli_storage 76.30μs ± 80.56ns 76.17μs — 76.48μs Report 📓
enc/large/musli_storage_packed 35.90μs ± 23.43ns 35.87μs — 35.95μs Report 📓
enc/large/musli_value1 760.74μs ± 699.21ns 759.64μs — 762.32μs Report 📓
enc/large/musli_wire 172.53μs ± 120.83ns 172.33μs — 172.80μs Report 📓
enc/large/serde_cbor 165.38μs ± 124.55ns 165.19μs — 165.66μs Report 📓
fewer/dec/allocated
Report 📓
Group Mean Interval Link
dec/allocated/musli_descriptive 2.42μs ± 2.87ns 2.41μs — 2.42μs Report 📓
dec/allocated/musli_storage 2.08μs ± 2.86ns 2.07μs — 2.08μs Report 📓
dec/allocated/musli_storage_packed 1.83μs ± 1.62ns 1.82μs — 1.83μs Report 📓
dec/allocated/musli_value1 1.49μs ± 1.35ns 1.49μs — 1.50μs Report 📓
dec/allocated/musli_wire 2.49μs ± 2.84ns 2.48μs — 2.49μs Report 📓
dec/allocated/serde_cbor 5.05μs ± 4.00ns 5.05μs — 5.06μs Report 📓
fewer/enc/allocated
Report 📓
Group Mean Interval Link
enc/allocated/musli_descriptive 622.80ns ± 1.06ns 620.98ns — 625.11ns Report 📓
enc/allocated/musli_storage 311.08ns ± 0.23ns 310.71ns — 311.60ns Report 📓
enc/allocated/musli_storage_packed 246.78ns ± 0.18ns 246.47ns — 247.18ns Report 📓
enc/allocated/musli_value1 1.95μs ± 2.39ns 1.94μs — 1.95μs Report 📓
enc/allocated/musli_wire 521.33ns ± 0.40ns 520.60ns — 522.16ns Report 📓
enc/allocated/serde_cbor 613.58ns ± 0.40ns 612.92ns — 614.46ns Report 📓

Müsli vs rkyv

Missing features:

Comparison between musli-zerocopy and rkyv.

Note that musli-zerocopy only supports the primitives benchmark.

More:

zerocopy-rkyv/dec/primitives
Report 📓
Group Mean Interval Link
dec/primitives/musli_zerocopy 4.39ns ± 0.00ns 4.38ns — 4.39ns Report 📓
dec/primitives/rkyv 11.09ns ± 0.01ns 11.08ns — 11.13ns Report 📓
zerocopy-rkyv/enc/primitives
Report 📓
Group Mean Interval Link
enc/primitives/musli_zerocopy 18.67ns ± 0.02ns 18.63ns — 18.71ns Report 📓
enc/primitives/rkyv 17.99ns ± 0.01ns 17.96ns — 18.02ns Report 📓
zerocopy-rkyv/dec/primpacked
Report 📓
Group Mean Interval Link
dec/primpacked/musli_zerocopy 2.63ns ± 0.00ns 2.63ns — 2.64ns Report 📓
dec/primpacked/rkyv 8.77ns ± 0.01ns 8.76ns — 8.78ns Report 📓
zerocopy-rkyv/enc/primpacked
Report 📓
Group Mean Interval Link
enc/primpacked/musli_zerocopy 17.23ns ± 0.02ns 17.20ns — 17.27ns Report 📓
enc/primpacked/rkyv 13.37ns ± 0.01ns 13.36ns — 13.39ns Report 📓

Müsli vs zerocopy

Compares musli-zerocopy with zerocopy.

Note that zerocopy only supports packed primitives, so we’re only comparing with that suite.

More:

zerocopy-zerocopy/dec/primpacked
Report 📓
Group Mean Interval Link
dec/primpacked/musli_zerocopy 2.63ns ± 0.00ns 2.63ns — 2.64ns Report 📓
dec/primpacked/zerocopy 5.26ns ± 0.00ns 5.26ns — 5.27ns Report 📓
zerocopy-zerocopy/enc/primpacked
Report 📓
Group Mean Interval Link
enc/primpacked/musli_zerocopy 18.44ns ± 0.02ns 18.41ns — 18.47ns Report 📓
enc/primpacked/zerocopy 7.94ns ± 0.01ns 7.93ns — 7.95ns Report 📓

Bitcode derive

Missing features:

Uses a custom derive-based framework which does not support everything Müsli and serde does.

More:

bitcode-derive/dec/primitives
Report 📓
Group Mean Interval Link
dec/primitives/derive_bitcode 245.41ns ± 0.26ns 245.00ns — 246.01ns Report 📓
dec/primitives/musli_descriptive 987.51ns ± 0.73ns 986.43ns — 989.18ns Report 📓
dec/primitives/musli_storage 425.46ns ± 0.44ns 424.69ns — 426.41ns Report 📓
dec/primitives/musli_storage_packed 93.95ns ± 0.14ns 93.71ns — 94.26ns Report 📓
dec/primitives/musli_wire 904.91ns ± 1.31ns 902.86ns — 907.88ns Report 📓
bitcode-derive/enc/primitives
Report 📓
Group Mean Interval Link
enc/primitives/derive_bitcode 1.28μs ± 0.94ns 1.27μs — 1.28μs Report 📓
enc/primitives/musli_descriptive 863.80ns ± 0.61ns 862.80ns — 865.18ns Report 📓
enc/primitives/musli_storage 292.02ns ± 0.30ns 291.53ns — 292.67ns Report 📓
enc/primitives/musli_storage_packed 132.54ns ± 0.12ns 132.34ns — 132.80ns Report 📓
enc/primitives/musli_wire 765.42ns ± 1.00ns 763.59ns — 767.50ns Report 📓
bitcode-derive/dec/primpacked
Report 📓
Group Mean Interval Link
dec/primpacked/derive_bitcode 244.16ns ± 0.17ns 243.90ns — 244.54ns Report 📓
dec/primpacked/musli_descriptive 972.94ns ± 1.12ns 971.37ns — 975.49ns Report 📓
dec/primpacked/musli_storage 488.69ns ± 0.90ns 487.18ns — 490.66ns Report 📓
dec/primpacked/musli_storage_packed 487.37ns ± 0.36ns 486.73ns — 488.14ns Report 📓
dec/primpacked/musli_wire 916.50ns ± 0.72ns 915.35ns — 918.09ns Report 📓
bitcode-derive/enc/primpacked
Report 📓
Group Mean Interval Link
enc/primpacked/derive_bitcode 1.32μs ± 1.71ns 1.31μs — 1.32μs Report 📓
enc/primpacked/musli_descriptive 873.25ns ± 0.96ns 871.57ns — 875.29ns Report 📓
enc/primpacked/musli_storage 231.99ns ± 0.18ns 231.70ns — 232.40ns Report 📓
enc/primpacked/musli_storage_packed 230.61ns ± 0.16ns 230.35ns — 230.98ns Report 📓
enc/primpacked/musli_wire 736.92ns ± 0.87ns 735.29ns — 738.72ns Report 📓
bitcode-derive/dec/medium_enum
Report 📓
Group Mean Interval Link
dec/medium_enum/derive_bitcode 3.27μs ± 2.32ns 3.27μs — 3.28μs Report 📓
dec/medium_enum/musli_descriptive 2.44μs ± 1.92ns 2.44μs — 2.45μs Report 📓
dec/medium_enum/musli_storage 1.36μs ± 1.32ns 1.36μs — 1.36μs Report 📓
dec/medium_enum/musli_storage_packed 1.01μs ± 1.11ns 1.01μs — 1.02μs Report 📓
dec/medium_enum/musli_wire 2.07μs ± 1.82ns 2.07μs — 2.08μs Report 📓
bitcode-derive/enc/medium_enum
Report 📓
Group Mean Interval Link
enc/medium_enum/derive_bitcode 13.23μs ± 15.20ns 13.21μs — 13.27μs Report 📓
enc/medium_enum/musli_descriptive 1.58μs ± 1.24ns 1.57μs — 1.58μs Report 📓
enc/medium_enum/musli_storage 669.16ns ± 0.47ns 668.37ns — 670.21ns Report 📓
enc/medium_enum/musli_storage_packed 499.98ns ± 0.42ns 499.23ns — 500.86ns Report 📓
enc/medium_enum/musli_wire 1.34μs ± 1.36ns 1.34μs — 1.34μs Report 📓
bitcode-derive/dec/large
Report 📓
Group Mean Interval Link
dec/large/derive_bitcode 32.86μs ± 39.23ns 32.79μs — 32.95μs Report 📓
dec/large/musli_descriptive 275.57μs ± 180.35ns 275.27μs — 275.97μs Report 📓
dec/large/musli_storage 92.76μs ± 64.70ns 92.66μs — 92.91μs Report 📓
dec/large/musli_storage_packed 50.48μs ± 54.71ns 50.38μs — 50.60μs Report 📓
dec/large/musli_wire 258.42μs ± 344.75ns 257.97μs — 259.19μs Report 📓
bitcode-derive/enc/large
Report 📓
Group Mean Interval Link
enc/large/derive_bitcode 84.21μs ± 151.77ns 83.99μs — 84.55μs Report 📓
enc/large/musli_descriptive 186.96μs ± 166.31ns 186.71μs — 187.34μs Report 📓
enc/large/musli_storage 63.90μs ± 55.40ns 63.82μs — 64.03μs Report 📓
enc/large/musli_storage_packed 29.68μs ± 21.35ns 29.64μs — 29.73μs Report 📓
enc/large/musli_wire 159.80μs ± 126.97ns 159.60μs — 160.09μs Report 📓
bitcode-derive/dec/allocated
Report 📓
Group Mean Interval Link
dec/allocated/derive_bitcode 3.95μs ± 5.32ns 3.94μs — 3.96μs Report 📓
dec/allocated/musli_descriptive 3.90μs ± 2.44ns 3.90μs — 3.91μs Report 📓
dec/allocated/musli_storage 3.27μs ± 3.81ns 3.26μs — 3.28μs Report 📓
dec/allocated/musli_storage_packed 2.98μs ± 1.97ns 2.98μs — 2.99μs Report 📓
dec/allocated/musli_wire 4.08μs ± 3.36ns 4.07μs — 4.08μs Report 📓
bitcode-derive/enc/allocated
Report 📓
Group Mean Interval Link
enc/allocated/derive_bitcode 7.02μs ± 11.28ns 7.00μs — 7.05μs Report 📓
enc/allocated/musli_descriptive 808.57ns ± 0.52ns 807.71ns — 809.73ns Report 📓
enc/allocated/musli_storage 374.40ns ± 0.39ns 373.75ns — 375.26ns Report 📓
enc/allocated/musli_storage_packed 304.21ns ± 0.20ns 303.88ns — 304.65ns Report 📓
enc/allocated/musli_wire 734.79ns ± 0.71ns 733.57ns — 736.33ns Report 📓

BSON

Missing features:

Specific comparison to BSON, because the format is limited in capabilities.

More:

bson/dec/primitives
Report 📓
Group Mean Interval Link
dec/primitives/bson2 2.27μs ± 4.40ns 2.26μs — 2.28μs Report 📓
dec/primitives/musli_descriptive 707.83ns ± 0.67ns 706.66ns — 709.28ns Report 📓
dec/primitives/musli_storage 378.56ns ± 0.47ns 377.98ns — 379.60ns Report 📓
dec/primitives/musli_storage_packed 82.90ns ± 0.09ns 82.79ns — 83.09ns Report 📓
dec/primitives/musli_wire 643.86ns ± 0.71ns 642.88ns — 645.46ns Report 📓
bson/enc/primitives
Report 📓
Group Mean Interval Link
enc/primitives/bson2 1.32μs ± 1.22ns 1.31μs — 1.32μs Report 📓
enc/primitives/musli_descriptive 532.31ns ± 0.38ns 531.65ns — 533.15ns Report 📓
enc/primitives/musli_storage 257.45ns ± 0.27ns 257.05ns — 258.07ns Report 📓
enc/primitives/musli_storage_packed 120.59ns ± 0.08ns 120.46ns — 120.77ns Report 📓
enc/primitives/musli_wire 416.91ns ± 0.47ns 416.14ns — 417.97ns Report 📓
bson/dec/primpacked
Report 📓
Group Mean Interval Link
dec/primpacked/bson2 3.04μs ± 4.75ns 3.03μs — 3.05μs Report 📓
dec/primpacked/musli_descriptive 735.76ns ± 0.55ns 734.82ns — 736.95ns Report 📓
dec/primpacked/musli_storage 403.59ns ± 0.26ns 403.16ns — 404.17ns Report 📓
dec/primpacked/musli_storage_packed 404.12ns ± 0.49ns 403.29ns — 405.17ns Report 📓
dec/primpacked/musli_wire 696.79ns ± 0.61ns 695.97ns — 698.17ns Report 📓
bson/enc/primpacked
Report 📓
Group Mean Interval Link
enc/primpacked/bson2 2.24μs ± 2.03ns 2.24μs — 2.25μs Report 📓
enc/primpacked/musli_descriptive 546.46ns ± 0.38ns 545.84ns — 547.32ns Report 📓
enc/primpacked/musli_storage 213.73ns ± 0.13ns 213.51ns — 214.03ns Report 📓
enc/primpacked/musli_storage_packed 213.82ns ± 0.17ns 213.53ns — 214.20ns Report 📓
enc/primpacked/musli_wire 462.48ns ± 0.51ns 461.50ns — 463.49ns Report 📓
bson/dec/medium_enum
Report 📓
Group Mean Interval Link
dec/medium_enum/bson2 7.32μs ± 10.08ns 7.30μs — 7.34μs Report 📓
dec/medium_enum/musli_descriptive 1.56μs ± 2.12ns 1.55μs — 1.56μs Report 📓
dec/medium_enum/musli_storage 878.37ns ± 1.33ns 876.30ns — 881.38ns Report 📓
dec/medium_enum/musli_storage_packed 583.09ns ± 0.36ns 582.53ns — 583.91ns Report 📓
dec/medium_enum/musli_wire 1.32μs ± 1.07ns 1.32μs — 1.32μs Report 📓
bson/enc/medium_enum
Report 📓
Group Mean Interval Link
enc/medium_enum/bson2 4.79μs ± 4.23ns 4.78μs — 4.79μs Report 📓
enc/medium_enum/musli_descriptive 1.15μs ± 0.80ns 1.15μs — 1.15μs Report 📓
enc/medium_enum/musli_storage 621.99ns ± 0.37ns 621.38ns — 622.81ns Report 📓
enc/medium_enum/musli_storage_packed 401.14ns ± 0.26ns 400.71ns — 401.70ns Report 📓
enc/medium_enum/musli_wire 840.45ns ± 0.60ns 839.53ns — 841.82ns Report 📓
bson/dec/large
Report 📓
Group Mean Interval Link
dec/large/bson2 1.56ms ± 2.30μs 1.56ms — 1.57ms Report 📓
dec/large/musli_descriptive 359.97μs ± 227.21ns 359.59μs — 360.47μs Report 📓
dec/large/musli_storage 148.37μs ± 119.84ns 148.18μs — 148.64μs Report 📓
dec/large/musli_storage_packed 88.68μs ± 69.49ns 88.57μs — 88.84μs Report 📓
dec/large/musli_wire 339.61μs ± 460.64ns 338.93μs — 340.67μs Report 📓
bson/enc/large
Report 📓
Group Mean Interval Link
enc/large/bson2 895.49μs ± 957.18ns 893.98μs — 897.65μs Report 📓
enc/large/musli_descriptive 232.10μs ± 274.39ns 231.71μs — 232.73μs Report 📓
enc/large/musli_storage 87.55μs ± 73.82ns 87.45μs — 87.72μs Report 📓
enc/large/musli_storage_packed 45.32μs ± 35.26ns 45.26μs — 45.40μs Report 📓
enc/large/musli_wire 188.99μs ± 208.58ns 188.64μs — 189.44μs Report 📓
bson/dec/allocated
Report 📓
Group Mean Interval Link
dec/allocated/bson2 8.28μs ± 7.23ns 8.26μs — 8.29μs Report 📓
dec/allocated/musli_descriptive 3.06μs ± 3.34ns 3.05μs — 3.07μs Report 📓
dec/allocated/musli_storage 2.77μs ± 4.56ns 2.76μs — 2.78μs Report 📓
dec/allocated/musli_storage_packed 2.55μs ± 2.53ns 2.54μs — 2.55μs Report 📓
dec/allocated/musli_wire 2.95μs ± 3.64ns 2.94μs — 2.96μs Report 📓
bson/enc/allocated
Report 📓
Group Mean Interval Link
enc/allocated/bson2 2.29μs ± 1.49ns 2.29μs — 2.29μs Report 📓
enc/allocated/musli_descriptive 539.12ns ± 0.41ns 538.43ns — 540.01ns Report 📓
enc/allocated/musli_storage 324.64ns ± 0.33ns 324.16ns — 325.39ns Report 📓
enc/allocated/musli_storage_packed 259.29ns ± 0.24ns 258.88ns — 259.80ns Report 📓
enc/allocated/musli_wire 433.67ns ± 0.37ns 433.00ns — 434.46ns Report 📓

Size comparisons

This is not yet an area which has received much focus, but because people are bound to ask the following section performs a raw size comparison between different formats. Each test suite serializes a collection of values, which have all been randomly populated.

Note so far these are all synthetic examples. Real world data is rarely this random. But hopefully it should give an idea of the extreme ranges.

Full features sizes

These frameworks provide a fair comparison against Müsli on various areas since they support the same set of features in what types of data they can represent.

framework primitives primpacked large allocated medium_enum
musli_descriptive 159.89 ± 1.56 165.80 ± 1.56 49227.10 ± 11024.16 647.93 ± 114.70 53.81 ± 64.94
musli_storage 115.00 ± 0.70 117.02 ± 0.73 34773.00 ± 7269.86 604.54 ± 112.02 40.90 ± 49.59
musli_storage_packed 98.00 ± 0.70 117.02 ± 0.73 31855.10 ± 6580.66 592.54 ± 112.02 38.77 ± 45.86
musli_wire 143.30 ± 1.77 148.43 ± 1.87 45860.00 ± 10213.50 634.69 ± 114.75 49.38 ± 59.50
postcard 110.85 ± 1.41 110.81 ± 1.34 34448.30 ± 7216.32 605.86 ± 113.01 39.62 ± 48.10
serde_bincode 94.96 ± 0.21 96.00 ± 0.00 32444.10 ± 6612.33 710.89 ± 117.76 42.39 ± 47.27
serde_bitcode 104.92 ± 0.38 105.00 ± 0.00 29918.20 ± 6055.10 600.54 ± 112.02 38.76 ± 46.90
serde_rmp 113.82 ± 0.73 119.88 ± 1.48 38929.60 ± 8350.45 612.41 ± 113.80 50.97 ± 50.74

Text-based formats sizes

These are text-based formats, which support the full feature set of this test suite.

framework primitives primpacked large allocated medium_enum
musli_json3 315.41 ± 2.37 335.29 ± 2.99 93162.10 ± 22814.18 832.66 ± 118.61 86.17 ± 115.66
serde_json3 435.41 ± 2.37 452.29 ± 2.99 102095.30 ± 24197.18 933.66 ± 118.61 107.17 ± 155.61

Fewer features sizes

Missing features:

This is a suite where support for 128-bit integers and maps are disabled. Usually because the underlying framework lacks support for them.

framework primitives primpacked large allocated medium_enum
musli_descriptive 116.36 ± 1.46 122.33 ± 1.46 30994.00 ± 9328.95 488.45 ± 97.86 48.29 ± 54.39
musli_storage 80.98 ± 0.71 83.05 ± 0.75 20507.20 ± 5971.92 458.59 ± 96.33 36.57 ± 42.32
musli_storage_packed 65.98 ± 0.71 83.05 ± 0.75 18267.20 ± 5341.41 448.59 ± 96.33 34.69 ± 39.82
musli_wire 101.86 ± 1.75 106.83 ± 1.77 28513.80 ± 8662.56 477.64 ± 98.04 44.07 ± 49.89
serde_cbor4 212.69 ± 0.53 221.17 ± 0.85 34759.30 ± 9429.15 566.69 ± 97.29 65.78 ± 80.46

Müsli vs rkyv sizes

Missing features:

Comparison between musli-zerocopy and rkyv.

Note that musli-zerocopy only supports the primitives benchmark.

framework primitives primpacked large allocated medium_enum
musli_zerocopy 96.00 ± 0.00 80.00 ± 0.00 - - -
rkyv3 96.00 ± 0.00 80.00 ± 0.00 11350.40 ± 4086.94 519.48 ± 78.55 148.83 ± 39.77

Müsli vs zerocopy sizes

Compares musli-zerocopy with zerocopy.

Note that zerocopy only supports packed primitives, so we’re only comparing with that suite.

framework primitives primpacked large allocated medium_enum
musli_zerocopy 112.00 ± 0.00 96.00 ± 0.00 - - -
zerocopy - 96.00 ± 0.00 - - -

Bitcode derive sizes

Missing features:

Uses a custom derive-based framework which does not support everything Müsli and serde does.

framework primitives primpacked large allocated medium_enum
derive_bitcode 104.92 ± 0.38 106.00 ± 0.00 29916.20 ± 6055.10 593.80 ± 109.31 38.68 ± 46.87
musli_descriptive 159.89 ± 1.56 165.80 ± 1.56 49227.10 ± 11024.16 639.17 ± 111.51 53.74 ± 64.92
musli_storage 115.00 ± 0.70 117.02 ± 0.73 34773.00 ± 7269.86 596.80 ± 109.31 40.82 ± 49.56
musli_storage_packed 98.00 ± 0.70 117.02 ± 0.73 31855.10 ± 6580.66 585.80 ± 109.31 38.70 ± 45.83
musli_wire 143.30 ± 1.77 148.43 ± 1.87 45860.00 ± 10213.50 627.14 ± 111.86 49.31 ± 59.47

BSON sizes

Missing features:

Specific comparison to BSON, because the format is limited in capabilities.

framework primitives primpacked large allocated medium_enum
bson 240.95 ± 0.22 289.00 ± 0.00 88697.60 ± 27440.34 759.57 ± 104.65 117.73 ± 114.42
musli_descriptive 115.35 ± 1.30 121.34 ± 1.28 47190.80 ± 14363.99 591.31 ± 103.15 58.34 ± 59.96
musli_storage 80.45 ± 0.53 82.50 ± 0.52 32636.40 ± 9632.82 564.69 ± 101.38 41.91 ± 44.57
musli_storage_packed 65.45 ± 0.53 82.50 ± 0.52 29620.40 ± 8685.51 554.69 ± 101.38 38.91 ± 41.10
musli_wire 100.85 ± 1.60 105.84 ± 1.57 43705.40 ± 13284.04 580.32 ± 103.13 52.30 ± 54.38
  1. musli-value is a heap-allocated, in-memory format. Deserialization is expected to be as fast as a dynamic in-memory structure can be traversed, but serialization requires a lot of allocations. It is only included for reference.  2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

  2. BSON does not support serializing directly in-place without patches. As a result it is expected to be much slower.  2 3 4 5 6 7 8 9 10

  3. These formats do not support a wide range of Rust types. Exact level of support varies. But from a size perspective it makes size comparisons either unfair or simply an esoteric exercise since they can (or cannot) make stricter assumptions as a result.  2 3

  4. Lacks 128-bit support.