Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible, non-graphical way of getting at system timing #2025

Open
ndarilek opened this issue Apr 27, 2021 · 7 comments
Open

Flexible, non-graphical way of getting at system timing #2025

ndarilek opened this issue Apr 27, 2021 · 7 comments
Labels
A-Accessibility A problem that prevents users with disabilities from using Bevy A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible S-Needs-Design This issue requires design work to think about how it would best be accomplished

Comments

@ndarilek
Copy link
Contributor

What problem does this solve or what need does it fill?

I'm having some performance issues with my game. While I suspect I know where they are, I'd rather get some exact numbers that I can crunch to determine which systems are slowing things down. I'm also blind, and unfortunately chrome://tracing doesn't appear accessible to me.

What solution would you like?

I'd like some way of either programatically or textually getting at system execution timing, in some way that I can spit out a textual report to get something like average/minimum/maximum execution time broken down by system.

What alternative(s) have you considered?

I'm not sure if the trace JSON reports do what I want, but either they don't or chrome://tracing is inaccessible. If this data is already available internally, I'd love to know about it so I can perhaps put together and contribute back some custom diagnostics.

Thanks.

@ndarilek ndarilek added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Apr 27, 2021
@cart
Copy link
Member

cart commented Apr 27, 2021

Yeah in addition to improving accessibility, this would also enable future editor tools to show things like "dynamic system performance graphs". I think this will likely be something like adding a new tracing subscriber that feeds data relevant to bevy into an ECS resource (probably the current Diagnostics abstraction).

Alternatively if that proves to be overly complicated, we could just manually instrument system schedulers to feed data into Diagnostics. But I'd like a generic tracing solution if possible, as that opens the doors to users instrumenting anything using normal tracing scopes and it showing up in our editor tooling.

@ndarilek
Copy link
Contributor Author

ndarilek commented Apr 27, 2021 via email

@cart
Copy link
Member

cart commented Apr 27, 2021

Hmm it looks like we lost the "automatic system spans" in Bevy 0.5's executor rewrite. Thats not awesome and we should add them back asap. We still have "stage spans" though.

So yeah in the short term you'll unfortunately need to annotate each system with a span manually.

I also don't think spans write anything to the console by default. That likely needs some additional tracing configuration and/or a different tracing subscriber.

On the topic of "release log level filtering" I do think we'll need to make that easier to configure. I don't want the production of trace and debug logs to slow down release builds by default, but we should:

  1. Make that easily configurable via feature flags
  2. Run some benchmarks to see how expensive leaving in trace/debug logs actually is. Maybe we don't need to filter them out by default.

@ndarilek
Copy link
Contributor Author

ndarilek commented Apr 27, 2021 via email

@Moxinilian Moxinilian added A-ECS Entities, components, systems, and events and removed S-Needs-Triage This issue needs to be labelled labels Apr 27, 2021
bors bot pushed a commit that referenced this issue Apr 28, 2021
As mentioned in #2025 (comment), systems used to have spans by default.

* add spans by default for every system executed
* create folder if missing for feature `wgpu_trace`
@mockersf
Copy link
Member

@ndarilek automatic system spans are back 👍

@Ratysz
Copy link
Contributor

Ratysz commented Apr 29, 2021

Hmm it looks like we lost the "automatic system spans" in Bevy 0.5's executor rewrite.

... yeah. I didn't note it down early on, so I plain forgot they even were a thing by the time all of that was done. Looks like it wasn't a hard fix, though.

@ndarilek
Copy link
Contributor Author

ndarilek commented Apr 29, 2021 via email

NiklasEi pushed a commit to NiklasEi/bevy that referenced this issue May 1, 2021
As mentioned in bevyengine#2025 (comment), systems used to have spans by default.

* add spans by default for every system executed
* create folder if missing for feature `wgpu_trace`
ostwilkens pushed a commit to ostwilkens/bevy that referenced this issue Jul 27, 2021
As mentioned in bevyengine#2025 (comment), systems used to have spans by default.

* add spans by default for every system executed
* create folder if missing for feature `wgpu_trace`
@alice-i-cecile alice-i-cecile added A-Accessibility A problem that prevents users with disabilities from using Bevy S-Needs-Design This issue requires design work to think about how it would best be accomplished labels Dec 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Accessibility A problem that prevents users with disabilities from using Bevy A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible S-Needs-Design This issue requires design work to think about how it would best be accomplished
Projects
None yet
Development

No branches or pull requests

6 participants