Repository navigation
fix: typing no longer stalls on the staged-changes gutter (#115) - #117
Merged
Merged
Conversation
…he gutter (#115) The staging gutter re-diffs the open file against HEAD and the index on every pause in typing. vscode-diff checks its 5 s time budget with Date.now() once per cell of its n×m table for texts under 1,700 lines together: 643,765 clock reads for one keystroke in an 800-line file. Where reading the clock is a system call (Linux on the hpet clocksource, ~1.2 µs) that is ~820 ms blocked per refresh; measured with a 1.2 µs clock: 823 ms before, 14 ms after. - lineDiff: 256 of vscode-diff's budget checks share one clock read (2,516 reads for the same edit). A spent budget stays spent; same results. - StagedGutter: an edit re-diffs the buffer against the HEAD/index text and conflict state git gave last time, instead of `git status` + two `git show`s per pause. Focus, save, ref/index moves and toggles still read git. A refresh waits for the running one for the same document, and an unchanged version is not re-diffed. - Blame: an untracked file is no longer blamed (and logged as a failure) on every edit. BlameProvider asks git whether the path is in HEAD (cat-file -e, not the translated message) and throws BlameNotCommittedError; the controller stops asking until git reports a repository change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #115.
The staging gutter re-diffed the buffer against HEAD and the index after each typing pause, synchronously on the extension host. Under 1,700 lines vscode-diff uses its DP table and checks its timeout (one
Date.now()) per cell: ~640k clock reads for one edit in an 800-line file. With a syscall clocksource (hpet, ~1.2 µs/read) that is ~820 ms per pause — matching the report (mean 758 ms, max 823 ms).DateTimeout.isValidshares one clock read per 256 checks; once expired it stays expired. Same results; covers the gutter, webview tick model, desktop and merge editor. 800-line edit at 1.2 µs/read: 643,765 reads / 823 ms → 2,516 / 14 ms.git show×2 /git statusper pause); focus, save, ref/index moves, settings and toggle still read git. In-flight refreshes coalesce; unchanged document versions skip.listChangeBlockssplit intoreadBaselines+changeBlocksFrom.git cat-file -e HEAD:<path>on failure →BlameNotCommittedError; not logged, and not retried until a repo change (commit / add).Tests (each fails on the old code): engine
diffClock,stagedGutterState(typing spawns no git),blameController.surface(untracked file blamed once, retried after commit), git-serviceindexWrites. engine 546, git-service 1408, webview-ui 573, merge-vscode 391, extension 1986, desktop 2014;verify --fastOK.🤖 Generated with Claude Code