Skip to content

Commit

Permalink
Remove old crates, clean up lints
Browse files Browse the repository at this point in the history
  • Loading branch information
djkoloski committed Sep 17, 2024
1 parent 62408e1 commit 12ec8ef
Show file tree
Hide file tree
Showing 28 changed files with 256 additions and 4,333 deletions.
41 changes: 12 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,14 @@ build = "build.rs"
# Some features may require multiple dependencies to compile properly
# For example, benchmarking bincode requires two features: "serde" and "bincode"
[dependencies]
abomonation = { version = "=0.7.3", optional = true }
abomonation_derive = { version = "=0.5.0", optional = true }
alkahest = { version = "=0.1.5", optional = true, features = [
"derive",
"nightly",
] }
bebop = { version = "=2.8.7", optional = true }
bilrost = { version = "=0.1010.0", optional = true }
bincode1 = { package = "bincode", version = "=1.3.3", optional = true }
# Can't call it bincode2 because of a current issue of bincode2
bincode = { package = "bincode", version = "=2.0.0-rc.3", optional = true }
bitcode = { version = "=0.6.0", optional = true }
bitcode = { version = "=0.6.3", optional = true }
borsh = { version = "=1.5.1", features = ["derive"], optional = true }
# TODO: Unfork after bson adds support for pre-warmed serialization buffers
# https://github.com/mongodb/bson-rust/pull/328
bson = { version = "=2.9.0", git = "https://github.com/djkoloski/bson-rust", branch = "add_into_vec", optional = true }
capnp = { version = "=0.19.6", optional = true }
cbor4ii = { version = "=0.3.2", features = [ "use_std", "serde1" ], optional = true }
capnp = { version = "=0.19.7", 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 }
Expand All @@ -72,38 +62,33 @@ 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 }
parity-scale-codec-derive = { version = "=3.6.12", optional = true }
postcard = { version = "=1.0.8", features = ["alloc"], optional = true }
pot = { version = "=3.0.0", optional = true }
postcard = { version = "=1.0.10", features = ["alloc"], optional = true }
pot = { version = "=3.0.1", optional = true }
pprof = { version = "=0.13.0", features = ["flamegraph"], optional = true }
prost = { version = "=0.12.6", optional = true }
prost = { version = "=0.13.2", optional = true }
rand = "=0.8.5"
rkyv = { version = "=0.8.5", optional = true }
rmp-serde = { version = "=1.3.0", optional = true }
ron = { version = "=0.8.1", optional = true }
serde = { version = "=1.0.204", features = ["derive"], 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.120", 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 }
savefile = { version = "=0.17.6", optional = true }
savefile-derive = { version = "=0.17.6", optional = true }
savefile = { version = "=0.17.7", optional = true }
savefile-derive = { version = "=0.17.7", optional = true }
wiring = { version = "=0.2.2", optional = true }
zstd = "=0.13.2"

[features]
default = [
"abomonation",
"abomonation_derive",
"alkahest",
# "bebop",
"bilrost",
"bincode1",
"bincode",
"bitcode",
"borsh",
"bson",
"capnp",
"cbor4ii",
"ciborium",
Expand All @@ -120,7 +105,6 @@ default = [
"rkyv",
"rmp-serde",
"ron",
"serde",
"serde_bare",
"serde_cbor",
"serde_json",
Expand All @@ -144,11 +128,10 @@ regenerate-prost = ["dep:prost-build"]
rand_pcg = "0.3.1"

[build-dependencies]
bebop-tools = "=2.8.7"
capnp = "=0.19.6"
capnp = "=0.19.7"
capnpc = { version = "=0.19.0", optional = true }
flatc-rust = { version = "=0.2.0", optional = true }
prost-build = { version = "=0.12.6", optional = true }
prost-build = { version = "=0.13.2", optional = true }

[[bench]]
harness = false
Expand Down
80 changes: 0 additions & 80 deletions benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#[allow(unused_imports)]
use criterion::{black_box, criterion_main, Criterion};
use rand_pcg::Lcg64Xsh32;
#[cfg(feature = "abomonation")]
use rust_serialization_benchmark::bench_abomonation;
#[cfg(feature = "alkahest")]
use rust_serialization_benchmark::bench_alkahest;
#[cfg(feature = "bilrost")]
use rust_serialization_benchmark::bench_bilrost;
#[cfg(feature = "bincode")]
Expand All @@ -15,8 +11,6 @@ use rust_serialization_benchmark::bench_bincode1;
use rust_serialization_benchmark::bench_bitcode;
#[cfg(feature = "borsh")]
use rust_serialization_benchmark::bench_borsh;
#[cfg(feature = "bson")]
use rust_serialization_benchmark::bench_bson;
#[cfg(feature = "capnp")]
use rust_serialization_benchmark::bench_capnp;
#[cfg(feature = "cbor4ii")]
Expand Down Expand Up @@ -82,25 +76,6 @@ fn bench_log(c: &mut Criterion) {
logs: generate_vec::<_, Log>(&mut rng, LOGS..LOGS + 1),
};

#[cfg(feature = "abomonation")]
bench_abomonation::bench(BENCH, c, &data, |data| {
for log in data.logs.iter() {
black_box(log.address);
black_box(log.code);
black_box(log.size);
}
});

// Doesn't use a closure due to ICE in rustc. Probably related to https://github.com/rust-lang/rust/issues/86703
#[cfg(feature = "alkahest")]
bench_alkahest::bench(BENCH, c, &data, |data| {
for log in data.logs {
black_box(&log.address);
black_box(log.code);
black_box(log.size);
}
});

#[cfg(feature = "bilrost")]
bench_bilrost::bench(BENCH, c, &data);

Expand All @@ -116,9 +91,6 @@ fn bench_log(c: &mut Criterion) {
#[cfg(feature = "borsh")]
bench_borsh::bench(BENCH, c, &data);

#[cfg(feature = "bson")]
bench_bson::bench(BENCH, c, &data);

#[cfg(feature = "capnp")]
bench_capnp::bench(BENCH, c, &data, |bytes| {
let message_reader =
Expand Down Expand Up @@ -281,21 +253,6 @@ fn bench_mesh(c: &mut Criterion) {
triangles: generate_vec::<_, Triangle>(&mut rng, TRIANGLES..TRIANGLES + 1),
};

#[cfg(feature = "abomonation")]
bench_abomonation::bench(BENCH, c, &data, |data| {
for triangle in data.triangles.iter() {
black_box(triangle.normal);
}
});

// Doesn't use a closure due to ICE in rustc. Probably related to https://github.com/rust-lang/rust/issues/86703
#[cfg(feature = "alkahest")]
bench_alkahest::bench(BENCH, c, &data, |mesh| {
for triangle in mesh.triangles {
black_box(&triangle.normal);
}
});

#[cfg(feature = "bilrost")]
bench_bilrost::bench(BENCH, c, &data);

Expand All @@ -311,9 +268,6 @@ fn bench_mesh(c: &mut Criterion) {
#[cfg(feature = "borsh")]
bench_borsh::bench(BENCH, c, &data);

#[cfg(feature = "bson")]
bench_bson::bench(BENCH, c, &data);

#[cfg(feature = "capnp")]
bench_capnp::bench(BENCH, c, &data, |bytes| {
let message_reader =
Expand Down Expand Up @@ -463,20 +417,6 @@ fn bench_minecraft_savedata(c: &mut Criterion) {
players: generate_vec::<_, Player>(&mut rng, PLAYERS..PLAYERS + 1),
};

#[cfg(feature = "abomonation")]
bench_abomonation::bench(BENCH, c, &data, |data| {
for player in data.players.iter() {
black_box(player.game_type);
}
});

#[cfg(feature = "alkahest")]
bench_alkahest::bench(BENCH, c, &data, |data| {
for player in data.players {
black_box(&player.game_type);
}
});

#[cfg(feature = "bilrost")]
bench_bilrost::bench(BENCH, c, &data);

Expand All @@ -492,9 +432,6 @@ fn bench_minecraft_savedata(c: &mut Criterion) {
#[cfg(feature = "borsh")]
bench_borsh::bench(BENCH, c, &data);

#[cfg(feature = "bson")]
bench_bson::bench(BENCH, c, &data);

#[cfg(feature = "capnp")]
bench_capnp::bench(BENCH, c, &data, |bytes| {
let message_reader =
Expand Down Expand Up @@ -647,20 +584,6 @@ fn bench_mk48(c: &mut Criterion) {
updates: generate_vec(&mut rng, UPDATES..UPDATES + 1),
};

#[cfg(feature = "abomonation")]
bench_abomonation::bench(BENCH, c, &data, |data| {
for update in data.updates.iter() {
black_box(update.score);
}
});

#[cfg(feature = "alkahest")]
bench_alkahest::bench(BENCH, c, &data, |data| {
for update in data.updates {
black_box(update.score);
}
});

#[cfg(feature = "bilrost")]
bench_bilrost::bench(BENCH, c, &data);

Expand All @@ -676,9 +599,6 @@ fn bench_mk48(c: &mut Criterion) {
#[cfg(feature = "borsh")]
bench_borsh::bench(BENCH, c, &data);

#[cfg(feature = "bson")]
bench_bson::bench(BENCH, c, &data);

#[cfg(feature = "capnp")]
bench_capnp::bench(BENCH, c, &data, |bytes| {
let message_reader =
Expand Down
13 changes: 0 additions & 13 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ use std::{
path::{Path, PathBuf},
};

// TODO: re-enable bebop
#[allow(dead_code)]
fn bebop_compile_dataset(name: &'static str) {
bebop_tools::download_bebopc(PathBuf::from("target").join("bebopc"));

bebop_tools::build_schema(
format!("./src/datasets/{0}/{0}.bop", name),
format!("./src/datasets/{0}/{0}_bebop.rs", name),
&bebop_tools::BuildConfig::default(),
);
}

#[cfg(feature = "regenerate-capnp")]
fn capnpc_compile_dataset(name: &'static str) -> capnp::Result<()> {
let mut command = capnpc::CompilerCommand::new();
Expand Down Expand Up @@ -71,7 +59,6 @@ fn main() {
{
const DATASETS: &[&str] = &["log", "mesh", "minecraft_savedata", "mk48"];
for &name in DATASETS.iter() {
// bebop_compile_dataset(name);
#[cfg(feature = "regenerate-capnp")]
capnpc_compile_dataset(name).unwrap();
#[cfg(feature = "regenerate-flatbuffers")]
Expand Down
13 changes: 7 additions & 6 deletions pages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ features = [
'HtmlSelectElement',
]

[profile.release]
codegen-units = 1
lto = true
opt-level = "z"
panic = "abort"
strip = "debuginfo"
# TODO: move this profile to the top level, but without affecting benchmarks?
# [profile.release]
# codegen-units = 1
# lto = true
# opt-level = "z"
# panic = "abort"
# strip = "debuginfo"
4 changes: 0 additions & 4 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# Ignore generated source files
ignore = [
"src/datasets/log/log_bebop.rs",
"src/datasets/log/log_capnp.rs",
"src/datasets/log/log_generated.rs",
"src/datasets/mesh/mesh_bebop.rs",
"src/datasets/mesh/mesh_capnp.rs",
"src/datasets/mesh/mesh_generated.rs",
"src/datasets/minecraft_savedata/minecraft_savedata_bebop.rs",
"src/datasets/minecraft_savedata/minecraft_savedata_capnp.rs",
"src/datasets/minecraft_savedata/minecraft_savedata_generated.rs",
"src/datasets/mk48/mk48_bebop.rs",
"src/datasets/mk48/mk48_capnp.rs",
"src/datasets/mk48/mk48_generated.rs",
]
60 changes: 0 additions & 60 deletions src/bench_abomonation.rs

This file was deleted.

Loading

0 comments on commit 12ec8ef

Please sign in to comment.