Skip to content

perf(graph): parse each cache glob pattern once - #887

Open
jasonkuhrt wants to merge 2 commits into
voidzero-dev:mainfrom
jasonkuhrt:perf/graph-glob-parse-once
Open

jasonkuhrt wants to merge 2 commits into
voidzero-dev:mainfrom
jasonkuhrt:perf/graph-glob-parse-once

Conversation

@jasonkuhrt

Copy link
Copy Markdown

Motivation

Building the task graph parsed every input and output pattern of every task with wax::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 every vp run: about 2 s of CPU before the first task. Details and measurements in #886.

Change

resolve_glob_to_workspace_relative keeps 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.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant