Crates.io | musli-tests |
lib.rs | musli-tests |
version | 0.0.26 |
source | src |
created_at | 2023-05-18 04:55:16.322336 |
updated_at | 2023-10-15 23:09:51.157854 |
description | Müsli is a flexible and generic binary serialization framework. |
homepage | https://github.com/udoprog/musli |
repository | https://github.com/udoprog/musli |
max_upload_size | |
id | 867459 |
size | 142,948 |
Helper utilities for ensuring that musli is safe to use and behaves as expected.
This does include a fairly sophisticated benchmarking suite.
Now this includes the extra
category, which requires model_minimal
. This
is not exactly a fair comparison, because it compares serialization formats
which were designed to model data that others are not capable off.
The exact tradeoff can be seen by comparing the feature model_full
with
model_minimal
.
cargo bench --no-default-features --features musli,full,extra,model_minimal,simdutf8
To run benchmarks for serialization suites which do support all features, do:
cargo bench --features full
This comes with the fuzz
binary which can do the following things.
Run serialization for a long time against a lot of random data. Both with and without miri. When run with miri, the size of the datasets is drastically reduced.
cargo run --bin fuzz
cargo +nightly miri run --bin fuzz
Run deserialization against randomly generated bytes. Both with and without miri. When run with miri, the size of the datasets is drastically reduced.
cargo run --bin fuzz -- --random
cargo +nightly miri run --bin fuzz -- --random
Note you can add the running of optional crates by enabling its corresponding feature, such as
--features bincode
.
dlhn
: Allocating and initializing large arrays based on untrusted input
(DoS): dlhn#11.To perform a one-off size comparison:
cargo run --bin fuzz -- --size
This will for now just take the first generated field of a given type, serialize it, and print out its size. In the future it will perform an average over the entire set with more statistics.