From 3bb2b1a154c69a9619b70f63ca157fd80731020e Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Thu, 11 Jul 2024 12:03:32 +0200 Subject: [PATCH] rearrange hierarchy and readme --- Cargo.toml | 2 +- benches_common/Cargo.toml | 10 -------- bevy_rapier3d/Cargo.toml | 1 - .../benches/common/mod.rs | 0 bevy_rapier3d/benches/cubes.rs | 5 +++- bevy_rapier3d/benches/many_pyramids3.rs | 4 ++++ .../Cargo.toml | 2 +- bevy_rapier_benches3d/README.md | 24 +++++++++++++++++++ .../src/main.rs | 0 custom_benches/README.md | 18 -------------- 10 files changed, 34 insertions(+), 32 deletions(-) delete mode 100644 benches_common/Cargo.toml rename benches_common/src/lib.rs => bevy_rapier3d/benches/common/mod.rs (100%) rename {custom_benches => bevy_rapier_benches3d}/Cargo.toml (94%) create mode 100644 bevy_rapier_benches3d/README.md rename {custom_benches => bevy_rapier_benches3d}/src/main.rs (100%) delete mode 100644 custom_benches/README.md diff --git a/Cargo.toml b/Cargo.toml index e231382e..69f7b7de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["bevy_rapier2d", "bevy_rapier3d", "custom_benches"] +members = ["bevy_rapier2d", "bevy_rapier3d"] resolver = "2" [profile.dev] diff --git a/benches_common/Cargo.toml b/benches_common/Cargo.toml deleted file mode 100644 index 91be3fc9..00000000 --- a/benches_common/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "benches_common" -version = "0.1.0" -license = "Apache-2.0" -edition = "2021" - -[dependencies] -bevy = { version = "0.14.0-rc.3", default-features = false } -bevy_rapier3d = { version = "0.27.0-rc.1", path = "../bevy_rapier3d", default-features = false } -divan = "0.1" diff --git a/bevy_rapier3d/Cargo.toml b/bevy_rapier3d/Cargo.toml index 6703766d..77faff1c 100644 --- a/bevy_rapier3d/Cargo.toml +++ b/bevy_rapier3d/Cargo.toml @@ -53,7 +53,6 @@ log = "0.4" serde = { version = "1", features = ["derive"], optional = true } [dev-dependencies] -benches_common = { version = "0.1", path = "../benches_common" } bevy = { version = "0.14", default-features = false, features = [ "x11", "tonemapping_luts", diff --git a/benches_common/src/lib.rs b/bevy_rapier3d/benches/common/mod.rs similarity index 100% rename from benches_common/src/lib.rs rename to bevy_rapier3d/benches/common/mod.rs diff --git a/bevy_rapier3d/benches/cubes.rs b/bevy_rapier3d/benches/cubes.rs index 99b91ca0..6095783f 100644 --- a/bevy_rapier3d/benches/cubes.rs +++ b/bevy_rapier3d/benches/cubes.rs @@ -2,7 +2,10 @@ //! //! -use benches_common::bench_app_updates; +mod common; + +use common::bench_app_updates; + use bevy::prelude::*; use bevy_rapier3d::math::*; use bevy_rapier3d::prelude::*; diff --git a/bevy_rapier3d/benches/many_pyramids3.rs b/bevy_rapier3d/benches/many_pyramids3.rs index 405af32e..ed001d6e 100644 --- a/bevy_rapier3d/benches/many_pyramids3.rs +++ b/bevy_rapier3d/benches/many_pyramids3.rs @@ -2,6 +2,10 @@ //! //! +mod common; + +use common::bench_app_updates; + use benches_common::bench_app_updates; use bevy::prelude::*; use bevy_rapier3d::math::*; diff --git a/custom_benches/Cargo.toml b/bevy_rapier_benches3d/Cargo.toml similarity index 94% rename from custom_benches/Cargo.toml rename to bevy_rapier_benches3d/Cargo.toml index e511f4fa..b40e2ed2 100644 --- a/custom_benches/Cargo.toml +++ b/bevy_rapier_benches3d/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "custom_benches" +name = "bevy_rapier_benches3d" version = "0.1.0" description = "Custom benchmarks for bevy_rapier." readme = "./README.md" diff --git a/bevy_rapier_benches3d/README.md b/bevy_rapier_benches3d/README.md new file mode 100644 index 00000000..96271738 --- /dev/null +++ b/bevy_rapier_benches3d/README.md @@ -0,0 +1,24 @@ +# bevy_rapier custom benches + +`bevy_rapier_benches3d` 's objective is to measure timings with detailed information +without spending too much time running multiple times expensive benchmarks. + +It is implemented as a standalone binary, running different scenes setup, gathering information +and outputs them at the end. + +```sh +cargo run --release -p bevy_rapier_benches3d +``` + +## cargo bench + +For short-lived benchmarks based on statistical analysis, +benchmarks can be run through the [divan](https://github.com/nvzqz/divan) bench harness. + +```sh +cargo bench -p bevy_rapier3d +``` + +## Other resources + +- [Bevy profiling](https://github.com/bevyengine/bevy/blob/main/docs/profiling.md) diff --git a/custom_benches/src/main.rs b/bevy_rapier_benches3d/src/main.rs similarity index 100% rename from custom_benches/src/main.rs rename to bevy_rapier_benches3d/src/main.rs diff --git a/custom_benches/README.md b/custom_benches/README.md deleted file mode 100644 index ee1996ed..00000000 --- a/custom_benches/README.md +++ /dev/null @@ -1,18 +0,0 @@ - -## cargo bench - -```sh -cargo bench -p bevy_rapier3d -``` - -## Custom benches - -```sh -cargo run --release -p custom_benches -``` - -## Flamegraph - -```sh -CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph -```