mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 22:50:19 +00:00
0917c49b9b
# Objective Partially addresses #3594. ## Solution This adds basic benchmarks for `List`, `Map`, and `Struct` implementors, both concrete (`Vec`, `HashMap`, and defined struct types) and dynamic (`DynamicList`, `DynamicMap` and `DynamicStruct`). A few insights from the benchmarks (all measurements are local on my machine): - Applying a list with many elements to a list with no elements is slower than applying to a list of the same length: - 3-4x slower when applying to a `Vec` - 5-6x slower when applying to a `DynamicList` I suspect this could be improved by `reserve()`ing the correct length up front, but haven't tested. - Applying a `DynamicMap` to another `Map` is linear in the number of elements, but applying a `HashMap` seems to be at least quadratic. No intuition on this one. - Applying like structs (concrete -> concrete, `DynamicStruct` -> `DynamicStruct`) seems to be faster than applying unlike structs.
67 lines
1.3 KiB
TOML
67 lines
1.3 KiB
TOML
[package]
|
|
name = "benches"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "Benchmarks for Bevy engine"
|
|
publish = false
|
|
license = "MIT OR Apache-2.0"
|
|
|
|
[dev-dependencies]
|
|
glam = "0.20"
|
|
rand = "0.8"
|
|
rand_chacha = "0.3"
|
|
criterion = { version = "0.3", features = ["html_reports"] }
|
|
bevy_ecs = { path = "../crates/bevy_ecs" }
|
|
bevy_reflect = { path = "../crates/bevy_reflect" }
|
|
bevy_tasks = { path = "../crates/bevy_tasks" }
|
|
bevy_utils = { path = "../crates/bevy_utils" }
|
|
|
|
[[bench]]
|
|
name = "archetype_updates"
|
|
path = "benches/bevy_ecs/archetype_updates.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "ecs_bench_suite"
|
|
path = "benches/bevy_ecs/ecs_bench_suite/mod.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "run_criteria"
|
|
path = "benches/bevy_ecs/run_criteria.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "commands"
|
|
path = "benches/bevy_ecs/commands.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "system_stage"
|
|
path = "benches/bevy_ecs/stages.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "world_get"
|
|
path = "benches/bevy_ecs/world_get.rs"
|
|
harness = false
|
|
|
|
[[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"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "iter"
|
|
path = "benches/bevy_tasks/iter.rs"
|
|
harness = false
|