Skip to content

Commit

Permalink
Merge branch 'main' into upstream-bevy-web-asset
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf authored Dec 14, 2024
2 parents e1fc632 + 6178ce9 commit d4e72b0
Show file tree
Hide file tree
Showing 267 changed files with 7,842 additions and 2,624 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Check for typos
uses: crate-ci/typos@v1.27.3
uses: crate-ci/typos@v1.28.2
- name: Typos info
if: failure()
run: |
Expand Down
16 changes: 15 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ bevy_ui_picking_backend = [
"bevy_internal/bevy_ui_picking_backend",
]

# Provides a debug overlay for bevy UI
bevy_ui_debug = ["bevy_internal/bevy_ui_debug"]

# Force dynamic linking, which improves iterative compile times
dynamic_linking = ["dep:bevy_dylib", "bevy_internal/dynamic_linking"]

Expand Down Expand Up @@ -487,7 +490,7 @@ futures-lite = "2.0.1"
async-std = "1.13"
crossbeam-channel = "0.5.0"
argh = "0.1.12"
thiserror = "1.0"
thiserror = "2.0"
event-listener = "5.3.0"
hyper = { version = "1", features = ["server", "http1"] }
http-body-util = "0.1"
Expand Down Expand Up @@ -2768,6 +2771,17 @@ description = "Test rendering of many cameras and lights"
category = "Stress Tests"
wasm = true

[[example]]
name = "many_components"
path = "examples/stress_tests/many_components.rs"
doc-scrape-examples = true

[package.metadata.example.many_components]
name = "Many Components (and Entities and Systems)"
description = "Test large ECS systems"
category = "Stress Tests"
wasm = false

[[example]]
name = "many_cubes"
path = "examples/stress_tests/many_cubes.rs"
Expand Down
86 changes: 43 additions & 43 deletions benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ edition = "2021"
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

[dev-dependencies]
glam = "0.29"
rand = "0.8"
rand_chacha = "0.3"
criterion = { version = "0.3", features = ["html_reports"] }
# Bevy crates
bevy_app = { path = "../crates/bevy_app" }
bevy_ecs = { path = "../crates/bevy_ecs", features = ["multi_threaded"] }
bevy_hierarchy = { path = "../crates/bevy_hierarchy" }
Expand All @@ -22,70 +21,71 @@ bevy_render = { path = "../crates/bevy_render" }
bevy_tasks = { path = "../crates/bevy_tasks" }
bevy_utils = { path = "../crates/bevy_utils" }

# make bevy_render compile on linux. x11 vs wayland does not matter here as the benches do not actually use a window
# Other crates
criterion = { version = "0.5.1", features = ["html_reports"] }
glam = "0.29"
rand = "0.8"
rand_chacha = "0.3"

# Make `bevy_render` compile on Linux with x11 windowing. x11 vs. Wayland does not matter here
# because the benches do not actually open any windows.
[target.'cfg(target_os = "linux")'.dev-dependencies]
bevy_winit = { path = "../crates/bevy_winit", features = ["x11"] }

[profile.release]
opt-level = 3
lto = true

[[bench]]
name = "change_detection"
path = "benches/bevy_ecs/change_detection.rs"
harness = 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"

[[bench]]
name = "ecs"
path = "benches/bevy_ecs/benches.rs"
harness = false
ptr_as_ptr = "warn"
ptr_cast_constness = "warn"
ref_as_ptr = "warn"

[[bench]]
name = "ray_mesh_intersection"
path = "benches/bevy_picking/ray_mesh_intersection.rs"
harness = false
# see: https://github.com/bevyengine/bevy/pull/15375#issuecomment-2366966219
too_long_first_doc_paragraph = "allow"

[[bench]]
name = "reflect_function"
path = "benches/bevy_reflect/function.rs"
harness = false
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] }
unsafe_op_in_unsafe_fn = "warn"
unused_qualifications = "warn"

[[bench]]
name = "reflect_list"
path = "benches/bevy_reflect/list.rs"
harness = false

[[bench]]
name = "reflect_map"
path = "benches/bevy_reflect/map.rs"
harness = false

[[bench]]
name = "reflect_struct"
path = "benches/bevy_reflect/struct.rs"
name = "ecs"
path = "benches/bevy_ecs/main.rs"
harness = false

[[bench]]
name = "parse_reflect_path"
path = "benches/bevy_reflect/path.rs"
name = "math"
path = "benches/bevy_math/main.rs"
harness = false

[[bench]]
name = "iter"
path = "benches/bevy_tasks/iter.rs"
name = "picking"
path = "benches/bevy_picking/main.rs"
harness = false

[[bench]]
name = "bezier"
path = "benches/bevy_math/bezier.rs"
name = "reflect"
path = "benches/bevy_reflect/main.rs"
harness = false

[[bench]]
name = "torus"
path = "benches/bevy_render/torus.rs"
name = "render"
path = "benches/bevy_render/main.rs"
harness = false

[[bench]]
name = "entity_hash"
path = "benches/bevy_ecs/world/entity_hash.rs"
name = "tasks"
path = "benches/bevy_tasks/main.rs"
harness = false
23 changes: 0 additions & 23 deletions benches/benches/bevy_ecs/benches.rs

This file was deleted.

19 changes: 10 additions & 9 deletions benches/benches/bevy_ecs/change_detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bevy_ecs::{
query::QueryFilter,
world::World,
};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use criterion::{black_box, criterion_group, Criterion};
use rand::{prelude::SliceRandom, SeedableRng};
use rand_chacha::ChaCha8Rng;

Expand All @@ -17,7 +17,6 @@ criterion_group!(
none_changed_detection,
multiple_archetype_none_changed_detection
);
criterion_main!(benches);

macro_rules! modify {
($components:ident;$($index:tt),*) => {
Expand Down Expand Up @@ -96,7 +95,7 @@ fn all_added_detection_generic<T: Component + Default>(group: &mut BenchGroup, e
},
|(ref mut world, ref mut query)| {
let mut count = 0;
for entity in query.iter(&world) {
for entity in query.iter(world) {
black_box(entity);
count += 1;
}
Expand Down Expand Up @@ -144,7 +143,7 @@ fn all_changed_detection_generic<T: Component<Mutability = Mutable> + Default +
},
|(ref mut world, ref mut query)| {
let mut count = 0;
for entity in query.iter(&world) {
for entity in query.iter(world) {
black_box(entity);
count += 1;
}
Expand Down Expand Up @@ -196,7 +195,7 @@ fn few_changed_detection_generic<T: Component<Mutability = Mutable> + Default +
(world, query)
},
|(ref mut world, ref mut query)| {
for entity in query.iter(&world) {
for entity in query.iter(world) {
black_box(entity);
}
},
Expand Down Expand Up @@ -238,7 +237,7 @@ fn none_changed_detection_generic<T: Component<Mutability = Mutable> + Default>(
},
|(ref mut world, ref mut query)| {
let mut count = 0;
for entity in query.iter(&world) {
for entity in query.iter(world) {
black_box(entity);
count += 1;
}
Expand Down Expand Up @@ -298,7 +297,9 @@ fn add_archetypes_entities<T: Component<Mutability = Mutable> + Default>(
}
}
}
fn multiple_archetype_none_changed_detection_generic<T: Component<Mutability = Mutable> + Default + BenchModify>(
fn multiple_archetype_none_changed_detection_generic<
T: Component<Mutability = Mutable> + Default + BenchModify,
>(
group: &mut BenchGroup,
archetype_count: u16,
entity_count: u32,
Expand Down Expand Up @@ -342,14 +343,14 @@ fn multiple_archetype_none_changed_detection_generic<T: Component<Mutability = M
},
|(ref mut world, ref mut query)| {
let mut count = 0;
for entity in query.iter(&world) {
for entity in query.iter(world) {
black_box(entity);
count += 1;
}
assert_eq!(0, count);
},
criterion::BatchSize::LargeInput,
)
);
},
);
}
Expand Down
7 changes: 3 additions & 4 deletions benches/benches/bevy_ecs/components/mod.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
use criterion::*;

mod add_remove;
mod add_remove_big_sparse_set;
mod add_remove_big_table;
mod add_remove_sparse_set;
mod add_remove_table;
mod add_remove_very_big_table;
mod add_remove;
mod archetype_updates;
mod insert_simple;
mod insert_simple_unbatched;

use archetype_updates::*;
use criterion::{criterion_group, Criterion};

criterion_group!(
components_benches,
benches,
add_remove,
add_remove_big,
add_remove_very_big,
Expand Down
Loading

0 comments on commit d4e72b0

Please sign in to comment.