mirror of
https://github.com/bevyengine/bevy
synced 2024-12-26 21:13:09 +00:00
a1a81e5721
# Objective `extract_meshes` can easily be one of the most expensive operations in the blocking extract schedule for 3D apps. It also has no fundamentally serialized parts and can easily be run across multiple threads. Let's speed it up by parallelizing it! ## Solution Use the `ThreadLocal<Cell<Vec<T>>>` approach utilized by #7348 in conjunction with `Query::par_iter` to build a set of thread-local queues, and collect them after going wide. ## Performance Using `cargo run --profile stress-test --features trace_tracy --example many_cubes`. Yellow is this PR. Red is main. `extract_meshes`: ![image](https://github.com/bevyengine/bevy/assets/3137680/9d45aa2e-3cfa-4fad-9c08-53498b51a73b) An average reduction from 1.2ms to 770us is seen, a 41.6% improvement. Note: this is still not including #9950's changes, so this may actually result in even faster speedups once that's merged in.
36 lines
1.2 KiB
TOML
36 lines
1.2 KiB
TOML
[package]
|
|
name = "bevy_pbr"
|
|
version = "0.12.0-dev"
|
|
edition = "2021"
|
|
description = "Adds PBR rendering to Bevy Engine"
|
|
homepage = "https://bevyengine.org"
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
license = "MIT OR Apache-2.0"
|
|
keywords = ["bevy"]
|
|
|
|
[features]
|
|
webgl = []
|
|
|
|
[dependencies]
|
|
# bevy
|
|
bevy_app = { path = "../bevy_app", version = "0.12.0-dev" }
|
|
bevy_asset = { path = "../bevy_asset", version = "0.12.0-dev" }
|
|
bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.12.0-dev" }
|
|
bevy_ecs = { path = "../bevy_ecs", version = "0.12.0-dev" }
|
|
bevy_math = { path = "../bevy_math", version = "0.12.0-dev" }
|
|
bevy_reflect = { path = "../bevy_reflect", version = "0.12.0-dev", features = ["bevy"] }
|
|
bevy_render = { path = "../bevy_render", version = "0.12.0-dev" }
|
|
bevy_transform = { path = "../bevy_transform", version = "0.12.0-dev" }
|
|
bevy_utils = { path = "../bevy_utils", version = "0.12.0-dev" }
|
|
bevy_window = { path = "../bevy_window", version = "0.12.0-dev" }
|
|
bevy_derive = { path = "../bevy_derive", version = "0.12.0-dev" }
|
|
|
|
# other
|
|
bitflags = "2.3"
|
|
fixedbitset = "0.4"
|
|
# direct dependency required for derive macro
|
|
bytemuck = { version = "1", features = ["derive"] }
|
|
naga_oil = "0.8"
|
|
radsort = "0.1"
|
|
smallvec = "1.6"
|
|
thread_local = "1.0"
|