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

Tracy profiling in pipelined-rendering #2834

Conversation

superdump
Copy link
Contributor

This has already been reviewed and merged into main but we need it on pipelined-rendering too for awesome profiling tools!

Tracy is:

A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications.

With the trace_tracy feature enabled, you run your bevy app and either a headless server (capture) or a live, interactive profiler UI (Tracy), and connect that to your bevy application to then stream the metric data and events, and save it or inspect it live/offline.

Previously when I implemented the spans across systems and stages and I was trying out different profiling tools, Tracy was too unstable on macOS to use. But now, quite some months later, it is working stably with Tracy 0.7.8. You can see timelines, aggregate statistics of mean system/stage execution times, and much more. It's very useful!

Screenshot_2021-09-15_at_18 07 19

  • Use the tracing-tracy crate which supports our tracing spans
  • Expose via the non-default feature trace_tracy for consistency with other trace* features

Objective

  • Describe the objective or issue this PR addresses.
  • If you're fixing a specific issue, say "Fixes #X".

Solution

  • Describe the solution used to achieve the objective above.

[Tracy](https://github.com/wolfpld/tracy) is:
> A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications.

With the `trace_tracy` feature enabled, you run your bevy app and either a headless server (`capture`) or a live, interactive profiler UI (`Tracy`), and connect that to your bevy application to then stream the metric data and events, and save it or inspect it live/offline.

Previously when I implemented the spans across systems and stages and I was trying out different profiling tools, Tracy was too unstable on macOS to use. But now, quite some months later, it is working stably with Tracy 0.7.8. You can see timelines, aggregate statistics of mean system/stage execution times, and much more. It's very useful!

![Screenshot_2021-09-15_at_18 07 19](https://user-images.githubusercontent.com/302146/133554920-350d3d45-fbb8-479f-91f7-7a7a4f9f5873.png)

- Use the `tracing-tracy` crate which supports our tracing spans
- Expose via the non-default feature `trace_tracy` for consistency with other `trace*` features
@DJMcNab
Copy link
Member

DJMcNab commented Sep 17, 2021

Is this not going to cause a problem when we land pipelined-rendering, since this would conflict with the same commit

I think the correct thing to do is to rebase pipelined-rendering onto main?

@alice-i-cecile alice-i-cecile added A-Core Common functionality for all bevy apps C-Performance A change motivated by improving speed, memory usage or compile times labels Sep 22, 2021
@cart
Copy link
Member

cart commented Nov 5, 2021

Sadly rebases aren't an option for pipelined-rendering because our oldest commits are not compatible with the latest commits. The only option at this point (if we want to preserve history) is a merge commit. I don't think a duplicate commit is the worst thing in the world in this context, but it should be avoided if possible.

Given that this already exists on main, I think the best solution is probably to not merge here and just merge pipelined-rendering into main asap.

@superdump
Copy link
Contributor Author

Fine by me. Closing.

@superdump superdump closed this Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Core Common functionality for all bevy apps C-Performance A change motivated by improving speed, memory usage or compile times
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants