-
Notifications
You must be signed in to change notification settings - Fork 42
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
Scope colors #19
Comments
I like the feature idea and I would use it myself. That said, I do have similar feelings about this as another feature request from before: #3 (comment)
If we did it, what do you think the API should look like? Two approaches come to mind:
The first approach is repetitive, but the second requires using thread locals which aren't free or async-friendly. Also, practically speaking, if multiple upstream crates hardcode their own colors for things, it might make the coloring less useful. Pushing/popping colors might help with this. |
I understand the concern here and fully agree on it, in general.
We need a mini-investigation on how the backends expose this, unless you already know :) |
It is probably possible to PR improvements to puffin and optick. We would still need to decide on what the profiling API would look like:
I don't plan to work on this myself at this time, but leaving it here for anyone who wants to pick it up. Happy to review PRs. |
Thank you for the investigation! I don't see how (2) push/pop approach is going to work. I want to have different layers of the stack using different colors, so it would force me to do a push -> marker -> pop at each stage, which is a waste. I.e. I will not be able to keep the pushed color for more than 1 scope anyway. The approach with categories (3) sounds very interesting. I like the idea, but I imagine that it may not work out. |
Would it be reasonable to expose the colors in this crate?
It would enhance the
tracy
backend experience quite a bit. For example, in https://github.com/gfx-rs/wgpu-rs/discussions/879 we would mark every crate (gfx/wgpu/wgpu-rs) with a separate color.https://github.com/davidwed/tracy#marking-zones describes the way to pass down colors in Tracy.
The text was updated successfully, but these errors were encountered: