Repository navigation
perf(editor): reduce redraw work during cursor navigation - #436
Merged
Merged
Conversation
Contributor
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Moving the cursor one line could rebuild indentation guides for the whole viewport and copy rows that Red had already saved in its last frame. Both costs showed up even when the cursor stayed in the same indentation scope.
This change reuses the guides until the scope, viewport or document changes. Cursor redraws compare affected rows against the last flushed frame, with the full redraw path handling invalidation and resize. It also fixes a Windows startup issue where the terminal's reply to a graphics capability query could arrive as keystrokes.
The new PTY/ConPTY replay sends real navigation commands, waits for each expected cursor position on the statusline, and checks the saved documents. The CI matrix covers cursor movement, scrolling, direction changes, and window and buffer switching on all three operating systems. For profiling,
RED_PERF=boundedrecords fixed-size histograms, and short traces correlate input dispatch with successful flushes.Measurements
In the final seven-pair macOS run, median in-viewport latency fell from 1.76 to 0.98 ms. The p95 moved from 3.79 to 3.73 ms and varied with host load. Linux in-viewport p95 fell from 1.82 to 1.15 ms, and scrolling p95 fell from 2.47 to 2.20 ms. Window and buffer switching showed no consistent speedup. Windows passed the interactive navigation and save checks. A full Windows timing comparison is still open. Measurement report
How to Test
cargo run --locked --release -- src/editor.rs. Move withjandkbetween lines of equal indentation, then into and back out of a nested block. The active guide should stay aligned within the first scope and move to the correct column at each boundary.:vsplit Cargo.tomland useCtrl-w wto return to the source file. Its cursor should return to the original line.cargo test --locked --release --lib editor::navigation_perf_tests::. To reproduce the timed runs, follow the native replay runbook.Local validation used the temporary dependency mirror. All 2,913 enabled library tests passed, and the 30-minute macOS soak verified the final document after 72,000 navigation inputs.