Repository navigation
perf(editor): accelerate large repository interactions - #332
Merged
Merged
Conversation
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.
Why
On repositories with thousands of files, Ctrl-P previously prepared every row and preview path on the editor thread, completion repeatedly scored and allocated across large language-server responses, and visible function-parameter help forced a full terminal redraw for every typed character. Those costs make both file lookup and ordinary function-call editing noticeably uneven.
What changed
Measurements
Measured against a Codex checkout containing 6,443 picker-visible files:
Completion filtering improved by 92%; query-history reuse keeps repeated completion backspaces near 24 microseconds.
How to Test
Build the editor and benchmark example:
Exercise both actual terminal interactions against a sibling Codex checkout:
Expect Ctrl-P to remain responsive while narrowing the path. The signature run should show
render:editor_windowsfor typed characters instead of onerender:fullper keystroke.Measure picker installation, large completion lists, backspacing, and large-buffer scans:
RED_FILE_PICKER_BENCH_ROOT=../codex cargo test --lib file_picker_large_workspace_performance -- --ignored --nocapture cargo run --example performance_hotspots -- completion cargo run --example performance_hotspots -- completion-backspace RED_COMPLETION_BENCH_FILE=../codex/codex-rs/tui/src/bottom_pane/chat_composer.rs cargo run --example performance_hotspots -- buffer-completionVerify completion acceptance, UTF-16/Unicode handling, and the docked-pane full-redraw regression:
Validated with strict all-target/all-feature Clippy, all 47 completion integration tests, and 2,394 unit tests using four test threads. The unchanged
plugin::runtime::tests::git_dashboard_renders_numstat_for_a_large_tracked_file_liststress test times out independently even when run alone and was excluded from the broad local unit run.