mirror of
https://github.com/bevyengine/bevy.git
synced 2026-07-01 08:12:51 -04:00
9ed66d7a06
# Objective Implement changes discussed with cart around erroring when using caching syntax where its not implemented. ## Solution Throw a compile error, in a way which is easy to remove once caching exists/works for more cases. Also contains a commit to alleviate trait errors which will (from my experience writing this PR and fixing them in bevy) arise from fixing this for existing bsn code. This commit can be dropped if not desired. This would ideally be fixed upstream so this workaround can be removed: https://github.com/rust-lang/rust/issues/141258#issuecomment-4565897810 Note: The error caused by this workaround is far from ideal. It initially looks like a method call is missing, but ultimately the hint/advice *is* correct <img width="1982" height="477" alt="image" src="https://github.com/user-attachments/assets/879f7630-ada8-4e63-9c59-80be466f37cf" /> ## Testing - `cargo test -p bevy_scene --lib` - `cargo check` --------- Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Bevy Benchmarks
This is a crate with a collection of benchmarks for Bevy.
Running benchmarks
Benchmarks can be run through Cargo:
# Run all benchmarks. (This will take a while!)
cargo bench -p benches
# Just compile the benchmarks, do not run them.
cargo bench -p benches --no-run
# Run the benchmarks for a specific crate. (See `Cargo.toml` for a complete list of crates
# tracked.)
cargo bench -p benches --bench ecs
# Filter which benchmarks are run based on the name. This will only run benchmarks whose name
# contains "name_fragment".
cargo bench -p benches -- name_fragment
# List all available benchmarks.
cargo bench -p benches -- --list
# Save a baseline to be compared against later.
cargo bench -p benches -- --save-baseline before
# Compare the current benchmarks against a baseline to find performance gains and regressions.
cargo bench -p benches -- --baseline before
Criterion
Bevy's benchmarks use Criterion. If you want to learn more about using Criterion for comparing performance against a baseline or generating detailed reports, you can read the Criterion.rs documentation.
You can generate nicely formatted comparison tables of named benchmark runs (baselines) using the critcmp tool.