Repository navigation
perf(runtime): accelerate editor and plugin hot paths - #309
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
Common Red interactions repeatedly traversed entire documents, rebuilt unchanged syntax and layout state, refreshed plugins and Git data unnecessarily, and copied values across plugin and language-service boundaries. Those costs compounded during typing, Vim editing, search, completion, workspace navigation, and startup.
What changed
Measured results
docs/performance-optimization-2026-08-21.mdrecords 417 independently measured runtime paths that improved by at least 50%, using frozen release baselines, alternating samples, and actual-terminal measurements where applicable. The median improvement is 90.56%; 213 paths improved by at least 90%, and 182 results come from real-terminal PTY sessions. Examples include:Single-file process startup, terminal diff/flush, durable recovery snapshot writes, some complete event paths, and platform-specific paths have not reached the 50% target and are explicitly tracked as follow-up work.
How to Test
Build the optimized editor and hotspot fixture:
Expect every bundled plugin to activate and
red self-check ok.Exercise real-terminal typing, incremental search, and file-picker latency:
Expect successful PTY sessions with populated event, highlighting, and rendering timing tables.
Check the offscreen Markdown fence regression and Unicode/CRLF rope boundaries:
Expect all focused tests to pass, including nested-language highlighting after the fence opener scrolls offscreen and exact Unicode/CRLF boundary handling.
Run the existing plugin callback performance gate:
Expect the benchmark assertions to pass.
Full validation passed:
cargo clippy --locked --all-targets --all-features -- -D warnings,cargo test --locked --all-targets --all-features -- --test-threads=1(2,302 unit tests passed, 2 ignored, plus every integration/example target), andcargo fmt --all -- --check.