Reduce GPU usage by activating VRR optimization only during high-rate input#45369
Merged
Reduce GPU usage by activating VRR optimization only during high-rate input#45369
Conversation
Only activate the variable refresh rate optimization when input arrives at a high rate (>= 60fps over the last 100ms). Once activated, sustain the optimization for 1 second to prevent display underclocking during active input.
This was referenced Dec 24, 2025
rtfeldman
pushed a commit
that referenced
this pull request
Jan 5, 2026
… input (#45369) Fixes #29073 This PR reduces unnecessary GPU usage by being more selective about when we present frames to prevent display underclocking (VRR optimization). ## Problem Previously, we would keep presenting frames for 1 second after *any* input event, regardless of whether it triggered a re-render. This caused unnecessary GPU work when the user was idle or during low-frequency interactions. ## Solution 1. **Only track input that triggers re-renders**: We now only record input timestamps when the input actually causes the window to become dirty, rather than on every input event. 2. **Rate-based activation**: The VRR optimization now only activates when input arrives at a high rate (≥ 60fps over the last 100ms). This means casual mouse movements or occasional keystrokes won't trigger continuous frame presentation. 3. **Sustained optimization**: Once high-rate input is detected (e.g., during scrolling or dragging), we sustain frame presentation for 1 second to prevent display underclocking, even if input briefly pauses. ## Implementation Added `InputRateTracker` which: - Tracks input timestamps in a 100ms sliding window - Activates when the window contains ≥ 6 events (60fps × 0.1s) - Extends a `sustain_until` timestamp by 1 second each time high rate is detected Release Notes: - Reduced GPU usage when idle by only presenting frames during bursts of high-frequency input.
LivioGama
pushed a commit
to LivioGama/zed
that referenced
this pull request
Jan 20, 2026
… input (zed-industries#45369) Fixes zed-industries#29073 This PR reduces unnecessary GPU usage by being more selective about when we present frames to prevent display underclocking (VRR optimization). ## Problem Previously, we would keep presenting frames for 1 second after *any* input event, regardless of whether it triggered a re-render. This caused unnecessary GPU work when the user was idle or during low-frequency interactions. ## Solution 1. **Only track input that triggers re-renders**: We now only record input timestamps when the input actually causes the window to become dirty, rather than on every input event. 2. **Rate-based activation**: The VRR optimization now only activates when input arrives at a high rate (≥ 60fps over the last 100ms). This means casual mouse movements or occasional keystrokes won't trigger continuous frame presentation. 3. **Sustained optimization**: Once high-rate input is detected (e.g., during scrolling or dragging), we sustain frame presentation for 1 second to prevent display underclocking, even if input briefly pauses. ## Implementation Added `InputRateTracker` which: - Tracks input timestamps in a 100ms sliding window - Activates when the window contains ≥ 6 events (60fps × 0.1s) - Extends a `sustain_until` timestamp by 1 second each time high rate is detected Release Notes: - Reduced GPU usage when idle by only presenting frames during bursts of high-frequency input.
LivioGama
pushed a commit
to LivioGama/zed
that referenced
this pull request
Jan 20, 2026
… input (zed-industries#45369) Fixes zed-industries#29073 This PR reduces unnecessary GPU usage by being more selective about when we present frames to prevent display underclocking (VRR optimization). ## Problem Previously, we would keep presenting frames for 1 second after *any* input event, regardless of whether it triggered a re-render. This caused unnecessary GPU work when the user was idle or during low-frequency interactions. ## Solution 1. **Only track input that triggers re-renders**: We now only record input timestamps when the input actually causes the window to become dirty, rather than on every input event. 2. **Rate-based activation**: The VRR optimization now only activates when input arrives at a high rate (≥ 60fps over the last 100ms). This means casual mouse movements or occasional keystrokes won't trigger continuous frame presentation. 3. **Sustained optimization**: Once high-rate input is detected (e.g., during scrolling or dragging), we sustain frame presentation for 1 second to prevent display underclocking, even if input briefly pauses. ## Implementation Added `InputRateTracker` which: - Tracks input timestamps in a 100ms sliding window - Activates when the window contains ≥ 6 events (60fps × 0.1s) - Extends a `sustain_until` timestamp by 1 second each time high rate is detected Release Notes: - Reduced GPU usage when idle by only presenting frames during bursts of high-frequency input.
LivioGama
pushed a commit
to LivioGama/zed
that referenced
this pull request
Feb 15, 2026
… input (zed-industries#45369) Fixes zed-industries#29073 This PR reduces unnecessary GPU usage by being more selective about when we present frames to prevent display underclocking (VRR optimization). ## Problem Previously, we would keep presenting frames for 1 second after *any* input event, regardless of whether it triggered a re-render. This caused unnecessary GPU work when the user was idle or during low-frequency interactions. ## Solution 1. **Only track input that triggers re-renders**: We now only record input timestamps when the input actually causes the window to become dirty, rather than on every input event. 2. **Rate-based activation**: The VRR optimization now only activates when input arrives at a high rate (≥ 60fps over the last 100ms). This means casual mouse movements or occasional keystrokes won't trigger continuous frame presentation. 3. **Sustained optimization**: Once high-rate input is detected (e.g., during scrolling or dragging), we sustain frame presentation for 1 second to prevent display underclocking, even if input briefly pauses. ## Implementation Added `InputRateTracker` which: - Tracks input timestamps in a 100ms sliding window - Activates when the window contains ≥ 6 events (60fps × 0.1s) - Extends a `sustain_until` timestamp by 1 second each time high rate is detected Release Notes: - Reduced GPU usage when idle by only presenting frames during bursts of high-frequency input.
This file contains hidden or 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
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.
Fixes #29073
This PR reduces unnecessary GPU usage by being more selective about when we present frames to prevent display underclocking (VRR optimization).
Problem
Previously, we would keep presenting frames for 1 second after any input event, regardless of whether it triggered a re-render. This caused unnecessary GPU work when the user was idle or during low-frequency interactions.
Solution
Only track input that triggers re-renders: We now only record input timestamps when the input actually causes the window to become dirty, rather than on every input event.
Rate-based activation: The VRR optimization now only activates when input arrives at a high rate (≥ 60fps over the last 100ms). This means casual mouse movements or occasional keystrokes won't trigger continuous frame presentation.
Sustained optimization: Once high-rate input is detected (e.g., during scrolling or dragging), we sustain frame presentation for 1 second to prevent display underclocking, even if input briefly pauses.
Implementation
Added
InputRateTrackerwhich:sustain_untiltimestamp by 1 second each time high rate is detectedRelease Notes: