-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 a setting to show time to first window draw and frames per second in status bar #16422
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now I need to build a UI to display it - Implement mechanism to track time from app launch to first window draw - Add TimeToFirstWindowDraw enum to represent initialization state - Modify App, AppContext, and WindowContext to support measurement - Log the duration once first window is drawn - Initialize measurement in main.rs
- Create new `performance` crate with settings and status bar item - Add `time_to_first_window_draw` accessor to AppContext - Implement togglable performance metrics in status bar - Add initialization of performance module in main
…t_window_draw We'll need to add support for handling the on_complete callback when drawing windows on Linux and Windows.
I used Claude to help me build an FPS counter that's efficient. Hopefully it's not too complicated, but this is a hot code path. This implementation uses a lock-free circular buffer to store frame timestamps and calculate FPS. It maintains a rolling window of frame times for the last second, allowing for smooth FPS updates without locking. Key features: - Uses atomic operations for thread-safety without locks - Maintains a fixed-size circular buffer of frame timestamps - Automatically removes old timestamps (>1 second old) - Calculates FPS based on frames in the last second - Efficient O(1) time complexity for both increment and FPS calculation
Release Notes: - Fixed an issue where an extra newline was inserted after running a `/file` command in the assistant.
Add language-specific subdirectory in example directory structure, since that's the requisite structure - see `extensions/languages.md` Release Notes: - N/A
390c99a
to
226481b
Compare
1 task
mrnugget
added a commit
that referenced
this pull request
Sep 6, 2024
This reverts the FPS counter added in 1175391 (#16422) because in this issue someone bisected recent performance regressions down to this commit: - #16729 Another issue that's possibly related: - #17305 (comment) We're reverthing this in a PR to create a bundle that people can try out. Co-authored-by: Bennet <bennet@zed.dev>
Merged
mrnugget
added a commit
that referenced
this pull request
Sep 6, 2024
**UPDATE**: Response so far seems to be that this fixes the performance issues on Intel MacBooks. So we're going to go ahead and merge it. This reverts the FPS counter added in 1175391 (#16422) because in this issue someone bisected recent performance regressions down to this commit: - #16729 Another issue that's possibly related: - #17305 (comment) We're reverting this in a PR to create a bundle that people can try out. Assets: - Universal Binary: https://github.com/zed-industries/zed/actions/runs/10735702994/artifacts/1900460781 - x86/Intel: https://github.com/zed-industries/zed/actions/runs/10735702994/artifacts/1900461236 - Apple Silicon: https://github.com/zed-industries/zed/actions/runs/10735702994/artifacts/1900460978 Release Notes: - Removed the recently-added FPS counter since the changes it made to the Metal renderer on macOS could lead to performance regressions on Intel MacBooks. Co-authored-by: Bennet <bennet@zed.dev>
notpeter
pushed a commit
that referenced
this pull request
Sep 6, 2024
**UPDATE**: Response so far seems to be that this fixes the performance issues on Intel MacBooks. So we're going to go ahead and merge it. This reverts the FPS counter added in 1175391 (#16422) because in this issue someone bisected recent performance regressions down to this commit: - #16729 Another issue that's possibly related: - #17305 (comment) We're reverting this in a PR to create a bundle that people can try out. Assets: - Universal Binary: https://github.com/zed-industries/zed/actions/runs/10735702994/artifacts/1900460781 - x86/Intel: https://github.com/zed-industries/zed/actions/runs/10735702994/artifacts/1900461236 - Apple Silicon: https://github.com/zed-industries/zed/actions/runs/10735702994/artifacts/1900460978 Release Notes: - Removed the recently-added FPS counter since the changes it made to the Metal renderer on macOS could lead to performance regressions on Intel MacBooks. Co-authored-by: Bennet <bennet@zed.dev>
notpeter
pushed a commit
that referenced
this pull request
Sep 6, 2024
**UPDATE**: Response so far seems to be that this fixes the performance issues on Intel MacBooks. So we're going to go ahead and merge it. This reverts the FPS counter added in 1175391 (#16422) because in this issue someone bisected recent performance regressions down to this commit: - #16729 Another issue that's possibly related: - #17305 (comment) We're reverting this in a PR to create a bundle that people can try out. Assets: - Universal Binary: https://github.com/zed-industries/zed/actions/runs/10735702994/artifacts/1900460781 - x86/Intel: https://github.com/zed-industries/zed/actions/runs/10735702994/artifacts/1900461236 - Apple Silicon: https://github.com/zed-industries/zed/actions/runs/10735702994/artifacts/1900460978 Release Notes: - Removed the recently-added FPS counter since the changes it made to the Metal renderer on macOS could lead to performance regressions on Intel MacBooks. Co-authored-by: Bennet <bennet@zed.dev>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I want to showcase Zed's performance via videos, and this seemed like a good way to demonstrate it.
120.fps.Tab.Switch.mp4
Release Notes:
performance.show_in_status_bar: true
in your settings to show the time to the first window draw on startup and then current FPS of the containing window's renderer.