2020-08-29 00:08:51 +00:00
|
|
|
[package]
|
|
|
|
name = "bevy_utils"
|
2024-07-08 12:54:08 +00:00
|
|
|
version = "0.15.0-dev"
|
2021-10-27 00:12:14 +00:00
|
|
|
edition = "2021"
|
2020-08-29 00:08:51 +00:00
|
|
|
description = "A collection of utils for Bevy Engine"
|
|
|
|
homepage = "https://bevyengine.org"
|
|
|
|
repository = "https://github.com/bevyengine/bevy"
|
2021-07-23 21:11:51 +00:00
|
|
|
license = "MIT OR Apache-2.0"
|
2020-08-29 00:08:51 +00:00
|
|
|
keywords = ["bevy"]
|
|
|
|
|
Introduce detailed_trace macro, use in TrackedRenderPass (#7639)
Profiles show that in extremely hot loops, like the draw loops in the renderer, invoking the trace! macro has noticeable overhead, even if the trace log level is not enabled.
Solve this by introduce a 'wrapper' detailed_trace macro around trace, that wraps the trace! log statement in a trivially false if statement unless a cargo feature is enabled
# Objective
- Eliminate significant overhead observed with trace-level logging in render hot loops, even when trace log level is not enabled.
- This is an alternative solution to the one proposed in #7223
## Solution
- Introduce a wrapper around the `trace!` macro called `detailed_trace!`. This macro wraps the `trace!` macro with an if statement that is conditional on a new cargo feature, `detailed_trace`. When the feature is not enabled (the default), then the if statement is trivially false and should be optimized away at compile time.
- Convert the observed hot occurrences of trace logging in `TrackedRenderPass` with this new macro.
Testing the results of
```
cargo run --profile stress-test --features bevy/trace_tracy --example many_cubes -- spheres
```
![image](https://user-images.githubusercontent.com/1222141/218298552-38551717-b062-4c64-afdc-a60267ac984d.png)
shows significant improvement of the `main_opaque_pass_3d` of the renderer, a median time decrease from 6.0ms to 3.5ms.
---
## Changelog
- For performance reasons, some detailed renderer trace logs now require the use of cargo feature `detailed_trace` in addition to setting the log level to `TRACE` in order to be shown.
## Migration Guide
- Some detailed bevy trace events now require the use of the cargo feature `detailed_trace` in addition to enabling `TRACE` level logging to view. Should you wish to see these logs, please compile your code with the bevy feature `detailed_trace`. Currently, the only logs that are affected are the renderer logs pertaining to `TrackedRenderPass` functions
2023-02-13 18:20:27 +00:00
|
|
|
[features]
|
2024-10-04 19:25:49 +00:00
|
|
|
default = ["std", "serde"]
|
2024-12-10 19:45:50 +00:00
|
|
|
std = ["alloc", "tracing/std", "foldhash/std", "dep:thread_local"]
|
|
|
|
alloc = ["hashbrown"]
|
|
|
|
detailed_trace = []
|
2024-10-04 19:25:49 +00:00
|
|
|
serde = ["hashbrown/serde"]
|
Introduce detailed_trace macro, use in TrackedRenderPass (#7639)
Profiles show that in extremely hot loops, like the draw loops in the renderer, invoking the trace! macro has noticeable overhead, even if the trace log level is not enabled.
Solve this by introduce a 'wrapper' detailed_trace macro around trace, that wraps the trace! log statement in a trivially false if statement unless a cargo feature is enabled
# Objective
- Eliminate significant overhead observed with trace-level logging in render hot loops, even when trace log level is not enabled.
- This is an alternative solution to the one proposed in #7223
## Solution
- Introduce a wrapper around the `trace!` macro called `detailed_trace!`. This macro wraps the `trace!` macro with an if statement that is conditional on a new cargo feature, `detailed_trace`. When the feature is not enabled (the default), then the if statement is trivially false and should be optimized away at compile time.
- Convert the observed hot occurrences of trace logging in `TrackedRenderPass` with this new macro.
Testing the results of
```
cargo run --profile stress-test --features bevy/trace_tracy --example many_cubes -- spheres
```
![image](https://user-images.githubusercontent.com/1222141/218298552-38551717-b062-4c64-afdc-a60267ac984d.png)
shows significant improvement of the `main_opaque_pass_3d` of the renderer, a median time decrease from 6.0ms to 3.5ms.
---
## Changelog
- For performance reasons, some detailed renderer trace logs now require the use of cargo feature `detailed_trace` in addition to setting the log level to `TRACE` in order to be shown.
## Migration Guide
- Some detailed bevy trace events now require the use of the cargo feature `detailed_trace` in addition to enabling `TRACE` level logging to view. Should you wish to see these logs, please compile your code with the bevy feature `detailed_trace`. Currently, the only logs that are affected are the renderer logs pertaining to `TrackedRenderPass` functions
2023-02-13 18:20:27 +00:00
|
|
|
|
2020-08-29 00:08:51 +00:00
|
|
|
[dependencies]
|
2024-12-10 19:45:50 +00:00
|
|
|
foldhash = { version = "0.1.3", default-features = false }
|
2024-09-18 16:00:03 +00:00
|
|
|
tracing = { version = "0.1", default-features = false }
|
2024-12-10 19:45:50 +00:00
|
|
|
hashbrown = { version = "0.15.1", features = [
|
|
|
|
"equivalent",
|
|
|
|
"raw-entry",
|
|
|
|
], optional = true, default-features = false }
|
2024-10-04 19:25:49 +00:00
|
|
|
thread_local = { version = "1.0", optional = true }
|
2020-10-21 22:55:35 +00:00
|
|
|
|
2024-01-02 22:08:30 +00:00
|
|
|
[dev-dependencies]
|
|
|
|
static_assertions = "1.1.0"
|
|
|
|
|
2020-10-21 22:55:35 +00:00
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
2023-10-25 19:20:17 +00:00
|
|
|
getrandom = { version = "0.2.0", features = ["js"] }
|
2024-10-04 19:25:49 +00:00
|
|
|
web-time = { version = "1.1" }
|
2023-11-18 20:58:48 +00:00
|
|
|
|
|
|
|
[lints]
|
|
|
|
workspace = true
|
2024-03-23 02:22:52 +00:00
|
|
|
|
|
|
|
[package.metadata.docs.rs]
|
2024-07-29 23:10:16 +00:00
|
|
|
rustdoc-args = ["-Zunstable-options", "--generate-link-to-definition"]
|
2024-03-23 02:22:52 +00:00
|
|
|
all-features = true
|