-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Add profiler autostart indicator to EditorRunBar #97492
Add profiler autostart indicator to EditorRunBar #97492
Conversation
3732717
to
30102c1
Compare
Just some thoughts. UPD 2025-03-19. |
Looks pretty good to me overall! I agree it might seem too distracting in the long run though, especially if some users want to always profile and are fine with the performance impact. But I'm also fine test driving it as is and seeing if users ask for changes. |
Maybe a softer yellow sure, but I agree with yellow in general since yellow = warning, and red = error in Godot already, and I do feel that this is more a light warning than a notification. |
I see some hard-coded values for the tab indices and profiler names. Ideally the profilers should register themselves to avoid hard-coding them. This can be refactored later though. |
if (any_profiler_active) { | ||
String tooltip = TTR("Autostart is enabled for the following profilers, which can have a performance impact:"); | ||
if (profiler_active) { | ||
tooltip += "\n- " + TTR("Profiler"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not important, but it's better to use PackedStringArray or StringBuilder instead for building the tooltip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation is ok, though as I mentioned, the hard-coding should be eventually removed.
Regarding the button's color and style: Initially, I went with a yellow icon and a flat button, but it looked off and wasn’t noticeable, so I inversed it. I realize this might feel a bit bold to some, but it provides a clear visual cue that your brain associates with "profiling mode." This can also work in reverse - you quickly notice when the indicator is absent, helping you spot when autostart isn't active but wanted. As for the color, if you can give me some suggestions I can try those, but IMO the default-warning-yellow works quite well here. @KoBeWi I forgot to add a note on the hardcoded values :) Yep, that felt horrible, but I fear it's currently the only way to achieve this. (however, I've added this to my profiler refactoring list) |
Needs rebase. |
30102c1
to
9f8bbe4
Compare
Rebased. |
Thanks! |
Followup to #96759
Addresses concerns that making the autostart of profilers persistent between sessions could lead to unexpected performance issues if users forget it's enabled.
Adds a small indicator near the EditorRunBar which shows up when autostart is enabled for any profiler.
Hovering shows the tooltip below.
Clicking opens the debugger view of the bottom panel and selects the first profiler for which autostart is enabled.