Repository navigation
perf(client): avoid whole-document work on each keystroke - #171
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
DontBlameMeDev
force-pushed
the
t3/63f59bad
branch
from
November 20, 2026 02:11
d2fce3b to
e166900
Compare
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.
Typing in a large shared buffer and republishing a large grant both did work proportional to the whole document or folder on every event. A one-line edit rebuilt two 100k-row shadow tables and scanned UTF-16 lengths line by line; a grant event revalidated every path from scratch.
The shadow is now patched in place, UTF-16 lengths are batched for ASCII documents, offset arithmetic caches the end of the document and computes both ends of a change in one pass, and grant path validation is cached across whole-listing republishes. Behavior and the shared contracts are unchanged.
Proof (Neovim v0.12.6, cheapest of five
os.clockruns, median of three runs):The rebuild-spread timing guard now samples a thousand rebuilds: after the in-place patch, ten rebuilds fell below
os.clockresolution on CI and made the ratio flaky.Checks:
bash scripts/test-lua.sh(18 files ALL OK),nvim --headless -l test/lua/document.lua(8 consecutive passes),npm run typecheck,npm test(182 pass), and the workspace contract checker (4 comparisons, 0 drifted, 0 errors). A differential script compared the old and new UTF-16 conversions over ASCII, BMP, astral, invalid, negative and out-of-range inputs with zero mismatches.scripts/ci-local.sh allpassed every part except e2e, which cannot start here because this worktree has no siblingreference_servercheckout orselvagedbinary; that is a pre-existing environment gap, unchanged by this PR.Reviewed with review-loop: 1 round with opencode-go/hy4-flash-free. verdict: approved
Created with opencode-go/hy4-flash-free in pi.