2020-08-29 00:08:51 +00:00
|
|
|
[package]
|
|
|
|
name = "bevy_utils"
|
2023-03-06 05:13:36 +00:00
|
|
|
version = "0.11.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]
|
|
|
|
detailed_trace = []
|
|
|
|
|
2020-08-29 00:08:51 +00:00
|
|
|
[dependencies]
|
2023-05-23 02:17:07 +00:00
|
|
|
ahash = "0.8.3"
|
2022-04-27 19:08:11 +00:00
|
|
|
tracing = { version = "0.1", default-features = false, features = ["std"] }
|
2020-11-22 00:38:24 +00:00
|
|
|
instant = { version = "0.1", features = ["wasm-bindgen"] }
|
2022-05-30 17:26:23 +00:00
|
|
|
uuid = { version = "1.1", features = ["v4", "serde"] }
|
2023-06-21 13:04:44 +00:00
|
|
|
hashbrown = { version = "0.14", features = ["serde"] }
|
2023-03-06 05:13:36 +00:00
|
|
|
bevy_utils_proc_macros = {version = "0.11.0-dev", path = "macros"}
|
2023-01-17 01:39:17 +00:00
|
|
|
petgraph = "0.6"
|
|
|
|
thiserror = "1.0"
|
2020-10-21 22:55:35 +00:00
|
|
|
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
2022-06-17 22:34:58 +00:00
|
|
|
getrandom = {version = "0.2.0", features = ["js"]}
|