Repository navigation
perf(graph): parse each cache glob pattern once - #887
Open
jasonkuhrt wants to merge 2 commits into
Open
jasonkuhrt wants to merge 2 commits into
jasonkuhrt wants to merge 2 commits into
Conversation
Building the task graph parsed and partitioned every input and output pattern of every task with wax, which compiles a regular expression for each. The partition depends on the pattern alone, so keep it per distinct pattern; the join with each package's directory and the workspace check still run for every use.
This branch has not been deployed
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.
Motivation
Building the task graph parsed every
inputandoutputpattern of every task withwax::Glob::new, which compiles a regular expression, then partitioned it, which compiles another; only the partition's text is used. Workspaces repeat the same patterns across packages, so a 138-package workspace compiled 13,708 patterns, 1,011 of them distinct, on everyvp run: about 2 s of CPU before the first task. Details and measurements in #886.Change
resolve_glob_to_workspace_relativekeeps each pattern's partition in a process-wide map, so a pattern is parsed and partitioned once. The partition depends on the pattern alone; the join with each package's directory and the outside-the-workspace check still run for every use, which the new test covers by resolving one pattern from two packages.A per-graph-load cache measured in #886 took a cached run from 4.45 s to 2.47 s CPU. This keeps the map for the process instead, which avoids threading a cache through the public resolve functions; the map holds one small entry per distinct pattern.