Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add opt-in optimization for static workspace patterns in 'project.setupWorkspaces' #6941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jordanoverbye wants to merge 2 commits into yarnpkg:master
base: master
Choose a base branch
Loading
from jordanoverbye:joverbye-workspaces-optimisation

Conversation

@jordanoverbye
Copy link

@jordanoverbye jordanoverbye commented Oct 14, 2025
edited
Loading

What's the problem this PR addresses?

All workspace patterns — including static paths like packages/foo/bar — are passed to fast-glob for resolution, even though they might not contain glob syntax which adds unnecessary overhead.

I work in a large monorepo with over 5,000 workspaces where project.setupWorkspaces() takes 920ms on average. The changes in this PR has reduced this setup time in our repo by about 21% (920ms => 719ms).

How did you fix it?

Introduced an opt-in enableWorkspacePatternAnalysis configuration option. When enabled, workspace patterns are split into static patterns (resolved directly) and dynamic patterns (resolved via fast-glob).

Defaults to false to preserve exisiting behaviour and this primarily benefits projects with mostly static workspace patterns.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

nathsimpson reacted with thumbs up emoji
@jordanoverbye jordanoverbye changed the title (削除) Add enableWorkspacePatternAnalysis configuration option (削除ここまで) (追記) Add opt-in optimization for static workspace patterns in 'project.setupWorkspaces' (追記ここまで) Oct 14, 2025
@jordanoverbye jordanoverbye force-pushed the joverbye-workspaces-optimisation branch 2 times, most recently from 9394d37 to 48fa100 Compare October 14, 2025 02:20

expect(manifest.resolutions).toEqual({
[`no-deps@npm:1.0.0`]: expect.stringMatching(/^patch:no-deps/),
[`no-deps@npm:1.0.0`]: expect.stringMatching(/^patch:no-deps/),
Copy link
Author

@jordanoverbye jordanoverbye Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was auto-generated when running yarn test:lint --fix

Without this change, I get the following error in CI:

/home/runner/work/berry/berry/packages/acceptance-tests/pkg-tests-specs/sources/commands/patchCommit.test.ts
Error: 117:1 error Expected indentation of 10 spaces but found 8 @stylistic/indent

}),
);

test(
Copy link
Author

@jordanoverbye jordanoverbye Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two tests that I've added here are duplicates of tests that already exist in this file, however these new tests have the enableWorkspacePatternAnalysis configuration turned on.

@jordanoverbye jordanoverbye force-pushed the joverbye-workspaces-optimisation branch from 48fa100 to 4533276 Compare October 14, 2025 09:17
@jordanoverbye jordanoverbye force-pushed the joverbye-workspaces-optimisation branch from 4533276 to 8d1d7ae Compare October 14, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /