![]() # Objective The `ArgList::push` family of methods consume `self` and return a new `ArgList` which means they can't be used with `&mut ArgList` references. ```rust fn foo(args: &mut ArgList) { args.push_owned(47_i32); // doesn't work :( } ``` It's typical for `push` methods on other existing types to take `&mut self`. ## Solution Renamed the existing push methods to `with_arg`, `with_ref` etc and added new `push` methods which take `&mut self`. ## Migration Guide Uses of the `ArgList::push` methods should be replaced with the `with` counterpart. <details> | old | new | | --- | --- | | push_arg | with_arg | | push_ref | with_ref | | push_mut | with_mut | | push_owned | with_owned | | push_boxed | with_boxed | </details> |
||
---|---|---|
.. | ||
benches | ||
src | ||
Cargo.toml | ||
README.md |
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.