Cache the staging relative-path list so truncated-path lookups don't re-walk the tree - #393
Open
TwitchBronBron wants to merge 1 commit into
Open
Cache the staging relative-path list so truncated-path lookups don't re-walk the tree#393TwitchBronBron wants to merge 1 commit into
TwitchBronBron wants to merge 1 commit into
Conversation
…re-walk the tree Resolving a truncated telnet debugger path calls findPartialFileInDirectory, which walked the entire staging tree (glob '**/*') on every call. Distinct truncated paths each triggered a fresh full walk during a debug session. - findPartialFileInDirectory now accepts an optional pre-computed relative-path list and only walks the tree itself when the list is omitted. - Project computes the staging relative-path list once per session (cached in getStagingRelativePaths) and buildStagingFileInfo passes it into findPartialFileInDirectory. The cache lives on Project (a new Project is created per debug session), so it can't go stale within a session, and a fresh session gets a fresh walk. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Resolving a truncated telnet debugger path goes through
findPartialFileInDirectory, which walked the entire staging tree (glob('**/*')) on every call. During a session, each distinct truncated path triggered a fresh full walk.findPartialFileInDirectorynow takes an optional pre-computed relative-path list and only walks the tree itself when the list is omitted.Projectcomputes the staging relative-path list once per session (cached ingetStagingRelativePaths), andbuildStagingFileInfopasses it in.The cache lives on
Project(created fresh per debug session), so it can't go stale within a session, and a new session gets a fresh walk.