From 4b38297cb1bd55369db768bd595d9a6bed808afa Mon Sep 17 00:00:00 2001 From: Flix Date: Sat, 28 Sep 2024 23:48:00 +0200 Subject: [PATCH] Adjust to crate rename --- Cargo.toml | 87 +++++++++++--------- benches/bench.rs | 20 ++--- src/{bench_brief.rs => bench_serde_brief.rs} | 12 +-- src/lib.rs | 4 +- 4 files changed, 66 insertions(+), 57 deletions(-) rename src/{bench_brief.rs => bench_serde_brief.rs} (53%) diff --git a/Cargo.toml b/Cargo.toml index fe875c4..27fdd9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [workspace] members = [ - "pages", - "tools/bencher", - "tools/formatter", - "tools/parser", - "tools/schema", + "pages", + "tools/bencher", + "tools/formatter", + "tools/parser", + "tools/schema", ] [workspace.package] @@ -49,9 +49,14 @@ bincode1 = { package = "bincode", version = "=1.3.3", optional = true } bincode = { package = "bincode", version = "=2.0.0-rc.3", optional = true } bitcode = { version = "=0.6.3", optional = true } borsh = { version = "=1.5.1", features = ["derive"], optional = true } -brief = { version = "=0.1.0", features = ["std"], optional = true, path = "../brief" } +serde-brief = { version = "=0.1.0", features = [ + "std", +], optional = true } capnp = { version = "=0.19.7", optional = true } -cbor4ii = { version = "=0.3.3", features = [ "use_std", "serde1" ], optional = true } +cbor4ii = { version = "=0.3.3", features = [ + "use_std", + "serde1", +], optional = true } ciborium = { version = "=0.2.2", optional = true } criterion = "=0.5.1" databuf = { version = "=0.5.0", optional = true } @@ -60,8 +65,10 @@ flatbuffers = { version = "=24.3.25", optional = true } libflate = "=2.1.0" msgpacker = { version = "=0.4.3", optional = true } nachricht-serde = { version = "=0.4.0", optional = true } -nanoserde = {version = "=0.1.37", optional = true } -parity-scale-codec = { version = "=3.6.12", features = ["full"], optional = true } +nanoserde = { version = "=0.1.37", optional = true } +parity-scale-codec = { version = "=3.6.12", features = [ + "full", +], optional = true } parity-scale-codec-derive = { version = "=3.6.12", optional = true } postcard = { version = "=1.0.10", features = ["alloc"], optional = true } pot = { version = "=3.0.1", optional = true } @@ -74,7 +81,9 @@ ron = { version = "=0.8.1", optional = true } serde = { version = "=1.0.210", features = ["derive"] } serde_bare = { version = "=0.5.0", optional = true } serde_cbor = { version = "=0.11.2", optional = true } -serde_json = { version = "=1.0.128", features = ["float_roundtrip"], optional = true } +serde_json = { version = "=1.0.128", features = [ + "float_roundtrip", +], optional = true } simd-json = { version = "=0.13.10", optional = true } simd-json-derive = { version = "=0.13.0", optional = true } speedy = { version = "=0.8.7", optional = true } @@ -85,35 +94,35 @@ zstd = "=0.13.2" [features] default = [ - "bilrost", - "bincode1", - "bincode", - "bitcode", - "borsh", - "brief", - "capnp", - "cbor4ii", - "ciborium", - "databuf", - "dlhn", - "flatbuffers", - "msgpacker", - "nachricht-serde", - "nanoserde", - "scale", - "postcard", - "pot", - "prost", - "rkyv", - "rmp-serde", - "ron", - "serde_bare", - "serde_cbor", - "serde_json", - "simd-json", - "speedy", - "savefile", - "wiring" + "bilrost", + "bincode1", + "bincode", + "bitcode", + "borsh", + "serde-brief", + "capnp", + "cbor4ii", + "ciborium", + "databuf", + "dlhn", + "flatbuffers", + "msgpacker", + "nachricht-serde", + "nanoserde", + "scale", + "postcard", + "pot", + "prost", + "rkyv", + "rmp-serde", + "ron", + "serde_bare", + "serde_cbor", + "serde_json", + "simd-json", + "speedy", + "savefile", + "wiring", ] capnp = ["dep:capnp"] prost = ["dep:capnp", "dep:prost"] diff --git a/benches/bench.rs b/benches/bench.rs index 181c120..e2ee15e 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -11,8 +11,8 @@ use rust_serialization_benchmark::bench_bincode1; use rust_serialization_benchmark::bench_bitcode; #[cfg(feature = "borsh")] use rust_serialization_benchmark::bench_borsh; -#[cfg(feature = "brief")] -use rust_serialization_benchmark::bench_brief; +#[cfg(feature = "serde-brief")] +use rust_serialization_benchmark::bench_serde_brief; #[cfg(feature = "capnp")] use rust_serialization_benchmark::bench_capnp; #[cfg(feature = "cbor4ii")] @@ -93,8 +93,8 @@ fn bench_log(c: &mut Criterion) { #[cfg(feature = "borsh")] bench_borsh::bench(BENCH, c, &data); - #[cfg(feature = "brief")] - bench_brief::bench(BENCH, c, &data); + #[cfg(feature = "serde-brief")] + bench_serde_brief::bench(BENCH, c, &data); #[cfg(feature = "capnp")] bench_capnp::bench(BENCH, c, &data, |bytes| { @@ -273,8 +273,8 @@ fn bench_mesh(c: &mut Criterion) { #[cfg(feature = "borsh")] bench_borsh::bench(BENCH, c, &data); - #[cfg(feature = "brief")] - bench_brief::bench(BENCH, c, &data); + #[cfg(feature = "serde-brief")] + bench_serde_brief::bench(BENCH, c, &data); #[cfg(feature = "capnp")] bench_capnp::bench(BENCH, c, &data, |bytes| { @@ -440,8 +440,8 @@ fn bench_minecraft_savedata(c: &mut Criterion) { #[cfg(feature = "borsh")] bench_borsh::bench(BENCH, c, &data); - #[cfg(feature = "brief")] - bench_brief::bench(BENCH, c, &data); + #[cfg(feature = "serde-brief")] + bench_serde_brief::bench(BENCH, c, &data); #[cfg(feature = "capnp")] bench_capnp::bench(BENCH, c, &data, |bytes| { @@ -610,8 +610,8 @@ fn bench_mk48(c: &mut Criterion) { #[cfg(feature = "borsh")] bench_borsh::bench(BENCH, c, &data); - #[cfg(feature = "brief")] - bench_brief::bench(BENCH, c, &data); + #[cfg(feature = "serde-brief")] + bench_serde_brief::bench(BENCH, c, &data); #[cfg(feature = "capnp")] bench_capnp::bench(BENCH, c, &data, |bytes| { diff --git a/src/bench_brief.rs b/src/bench_serde_brief.rs similarity index 53% rename from src/bench_brief.rs rename to src/bench_serde_brief.rs index 2fccf25..664cfaa 100644 --- a/src/bench_brief.rs +++ b/src/bench_serde_brief.rs @@ -7,29 +7,29 @@ where { const BUFFER_LEN: usize = 50_000_000; - let mut group = c.benchmark_group(format!("{}/brief", name)); + let mut group = c.benchmark_group(format!("{}/serde-brief", name)); let mut serialize_buffer = vec![0; BUFFER_LEN]; group.bench_function("serialize", |b| { b.iter(|| { black_box( - brief::to_slice(black_box(&data), black_box(serialize_buffer.as_mut_slice())) + serde_brief::to_slice(black_box(&data), black_box(serialize_buffer.as_mut_slice())) .unwrap(), ); }) }); - let deserialize_buffer = brief::to_vec(&data).unwrap(); + let deserialize_buffer = serde_brief::to_vec(&data).unwrap(); group.bench_function("deserialize", |b| { b.iter(|| { - black_box(brief::from_slice::<'_, T>(black_box(&deserialize_buffer)).unwrap()); + black_box(serde_brief::from_slice::<'_, T>(black_box(&deserialize_buffer)).unwrap()); }) }); - crate::bench_size(name, "brief", deserialize_buffer.as_slice()); + crate::bench_size(name, "serde-brief", deserialize_buffer.as_slice()); - assert!(brief::from_slice::(&deserialize_buffer).unwrap() == *data); + assert!(serde_brief::from_slice::(&deserialize_buffer).unwrap() == *data); group.finish(); } diff --git a/src/lib.rs b/src/lib.rs index 1dff005..fab8da1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,8 +11,8 @@ pub mod bench_bincode1; pub mod bench_bitcode; #[cfg(feature = "borsh")] pub mod bench_borsh; -#[cfg(feature = "brief")] -pub mod bench_brief; +#[cfg(feature = "serde-brief")] +pub mod bench_serde_brief; #[cfg(feature = "capnp")] pub mod bench_capnp; #[cfg(feature = "cbor4ii")]