Walk the staging tree for .map files once per breakpoint pass, not once per breakpoint - #391
Open
TwitchBronBron wants to merge 1 commit into
Open
Walk the staging tree for .map files once per breakpoint pass, not once per breakpoint#391TwitchBronBron wants to merge 1 commit into
TwitchBronBron wants to merge 1 commit into
Conversation
…ce per breakpoint
LocationManager.getStagingLocations ran a synchronous glob.sync('**/*.map') over the
entire staging dir on every call, and getBreakpointWork calls it once per breakpoint.
With N breakpoints that's N full-tree walks during breakpoint validation (on the launch
path). This is the same anti-pattern that caused the findEntryPoint hang.
- Add LocationManager.getStagingMapPaths(stagingDir) and let getStagingLocations accept a
pre-computed list of map paths, falling back to walking the tree when omitted.
- getBreakpointWork now walks once up front and passes the list to every getStagingLocations
call, so the staging tree is walked a single time regardless of breakpoint count.
Globbing fresh at the start of each validation pass (rather than caching across launches)
keeps correctness when staging content changes between launches.
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.
LocationManager.getStagingLocationsruns a synchronousglob.sync('**/*.map')over the entire staging dir on every call, andgetBreakpointWorkcalls it once per breakpoint. So validating N breakpoints means walking the whole staging tree N times — on the launch path. Same anti-pattern as thefindEntryPointhang.LocationManager.getStagingMapPaths(stagingDir)and letgetStagingLocationstake a pre-computed map-path list, falling back to walking the tree when it's omitted.getBreakpointWorknow walks once up front and passes the list into everygetStagingLocationscall, so the tree is walked a single time regardless of breakpoint count.Globbing fresh at the start of each validation pass (rather than caching across launches) keeps this correct when staging content changes between launches.