mirror of
https://github.com/bevyengine/bevy.git
synced 2026-07-03 17:24:00 -04:00
aaec9e8d5b
# Objective
- Add performance benchmarks for camera primitives to track the
efficiency of intersection tests.
## Solution
- Created a new benchmark suite `bevy_camera`.
## Testing
- Ran the benchmarks locally using `cargo bench -p benches --bench
camera -- --save-baseline main intersects_obb`.
```
intersects_obb/sphere_intersects_obb
time: [6.5819 ns 6.6022 ns 6.6255 ns]
intersects_obb/frustum_intersects_obb
time: [14.919 ns 14.954 ns 14.991 ns]
intersects_obb/frustum_intersects_obb_fallback_identity
time: [14.940 ns 14.965 ns 14.993 ns]
intersects_obb/frustum_intersects_obb_identity
time: [6.8076 ns 6.8173 ns 6.8276 ns]
```
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
124 lines
3.3 KiB
TOML
124 lines
3.3 KiB
TOML
[package]
|
|
name = "benches"
|
|
edition = "2024"
|
|
description = "Benchmarks that test Bevy's performance"
|
|
publish = false
|
|
license = "MIT OR Apache-2.0"
|
|
# Do not automatically discover benchmarks, we specify them manually instead.
|
|
autobenches = false
|
|
|
|
[dependencies]
|
|
# The primary crate that runs and analyzes our benchmarks. This is a regular dependency because the
|
|
# `bench!` macro refers to it in its documentation.
|
|
criterion = { version = "0.8.0", features = ["html_reports"] }
|
|
seq-macro = "0.3.6"
|
|
|
|
[dev-dependencies]
|
|
# Bevy crates
|
|
bevy_app = { path = "../crates/bevy_app" }
|
|
bevy_ecs = { path = "../crates/bevy_ecs", features = ["multi_threaded"] }
|
|
bevy_math = { path = "../crates/bevy_math" }
|
|
bevy_picking = { path = "../crates/bevy_picking", features = ["mesh_picking"] }
|
|
bevy_reflect = { path = "../crates/bevy_reflect", features = ["functions"] }
|
|
bevy_camera = { path = "../crates/bevy_camera" }
|
|
bevy_mesh = { path = "../crates/bevy_mesh" }
|
|
bevy_asset = { path = "../crates/bevy_asset" }
|
|
bevy_render = { path = "../crates/bevy_render" }
|
|
bevy_scene = { path = "../crates/bevy_scene" }
|
|
bevy_tasks = { path = "../crates/bevy_tasks" }
|
|
bevy_transform = { path = "../crates/bevy_transform" }
|
|
bevy_ui = { path = "../crates/bevy_ui" }
|
|
bevy_platform = { path = "../crates/bevy_platform", default-features = false, features = [
|
|
"std",
|
|
] }
|
|
|
|
# Other crates
|
|
glam = { version = "0.32.0", default-features = false, features = [
|
|
"std",
|
|
"rand",
|
|
] }
|
|
rand = "0.10"
|
|
chacha20 = { version = "0.10.0", default-features = false, features = ["rng"] }
|
|
nonmax = { version = "0.5", default-features = false }
|
|
|
|
[lints.clippy]
|
|
doc_markdown = "warn"
|
|
manual_let_else = "warn"
|
|
match_same_arms = "warn"
|
|
redundant_closure_for_method_calls = "warn"
|
|
redundant_else = "warn"
|
|
semicolon_if_nothing_returned = "warn"
|
|
type_complexity = "allow"
|
|
undocumented_unsafe_blocks = "warn"
|
|
unwrap_or_default = "warn"
|
|
needless_lifetimes = "allow"
|
|
too_many_arguments = "allow"
|
|
nonstandard_macro_braces = "warn"
|
|
|
|
ptr_as_ptr = "warn"
|
|
ptr_cast_constness = "warn"
|
|
ref_as_ptr = "warn"
|
|
|
|
# see: https://github.com/bevyengine/bevy/pull/15375#issuecomment-2366966219
|
|
too_long_first_doc_paragraph = "allow"
|
|
|
|
allow_attributes = "warn"
|
|
allow_attributes_without_reason = "warn"
|
|
|
|
[lints.rust]
|
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] }
|
|
unsafe_op_in_unsafe_fn = "warn"
|
|
unused_qualifications = "warn"
|
|
|
|
[lib]
|
|
# This fixes the "Unrecognized Option" error when running commands like
|
|
# `cargo bench -- --save-baseline before` by disabling the default benchmark harness.
|
|
# See <https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options>
|
|
# for more information.
|
|
bench = false
|
|
|
|
[[bench]]
|
|
name = "ecs"
|
|
path = "benches/bevy_ecs/main.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "math"
|
|
path = "benches/bevy_math/main.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "picking"
|
|
path = "benches/bevy_picking/main.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "reflect"
|
|
path = "benches/bevy_reflect/main.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "render"
|
|
path = "benches/bevy_render/main.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "scene"
|
|
path = "benches/bevy_scene/main.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "tasks"
|
|
path = "benches/bevy_tasks/main.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "camera"
|
|
path = "benches/bevy_camera/main.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "transform"
|
|
path = "benches/bevy_transform/main.rs"
|
|
harness = false
|