Skip to content

perf(session): share one GlobResolver across task graph loading and planning - #890

Merged
wan9chi merged 2 commits into
mainfrom
perf/share-glob-resolver
Oct 26, 2026
Merged

wan9chi merged 2 commits into
mainfrom
perf/share-glob-resolver

Conversation

@wan9chi

@wan9chi wan9chi commented Oct 26, 2026

Copy link
Copy Markdown
Member

Motivation

#887 parses each cache glob pattern once per GlobResolver, but a vp run used several: one while loading the task graph, one for each plan, and a fresh one for each execute_synthetic call. A pattern used by both a task config and a synthetic command's cache config was parsed once in each, and a bare vp run that falls through to the task selector parsed its synthetic patterns again in the second plan.

Change

Session owns one Rc<GlobResolver> and passes it to IndexedTaskGraph::load, plan_query and plan_synthetic. The lazy task graph loader keeps a clone of it, so the TaskGraphLoader trait is unchanged, and PlanContext::new takes the resolver instead of creating one.

🤖 Generated with Claude Code

wan9chi and others added 2 commits October 26, 2026 15:11
…lanning

The session now owns the resolver and passes it to `IndexedTaskGraph::load`,
`plan_query` and `plan_synthetic`, so a cache glob pattern that both a
task config and a synthetic command use is parsed once per session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.77%  [ -4.61% ..  +6.90%]  overhead   +57.65%
dynamic/access             change  +0.80%  [ -3.91% ..  +4.79%]  overhead   +21.45%
dynamic/access-relative    change  +0.00%  [ -3.70% ..  +4.38%]  overhead   +68.28%
dynamic/access-contended   change  -2.03%  [ -7.15% ..  +5.38%]  overhead   +48.16%
static/launch              change  +0.22%  [ -3.51% ..  +5.28%]  overhead  +197.99%
static/access              change  +0.32%  [ -1.30% ..  +1.87%]  overhead +1383.13%
static/access-relative     change  +0.39%  [ -2.37% ..  +2.22%]  overhead +1892.37%
static/access-contended    change  +0.34%  [ -0.67% ..  +1.96%]  overhead +2148.60%

macos

dynamic/launch             change  +0.96%  [ -5.89% ..  +5.91%]  overhead  +229.66%
dynamic/access             change  +0.31%  [-12.66% .. +19.01%]  overhead    +0.00%
dynamic/access-relative    change  -0.53%  [-12.06% .. +12.08%]  overhead  +227.18%
dynamic/access-contended   change  +0.84%  [-83.17% .. +38.65%]  overhead    +1.36%

windows

dynamic/launch             change  -0.28%  [ -2.29% ..  +1.46%]  overhead   +28.96%
dynamic/access             change  +0.00%  [ -0.44% ..  +0.44%]  overhead    +1.34%
dynamic/access-relative    change  +0.00%  [ -0.63% ..  +0.64%]  overhead    +1.08%
dynamic/access-contended   change  +0.42%  [ -1.04% ..  +4.18%]  overhead    +1.69%

@wan9chi
wan9chi merged commit 0770bb4 into main Oct 26, 2026
21 checks passed
@wan9chi
wan9chi deleted the perf/share-glob-resolver branch October 26, 2026 06:18
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