Skip to content

Reuse compiled workspace exclusion patterns - #4

Closed
zanieb wants to merge 8 commits into
mainfrom
zb/bughuntperf/213-workspace-exclude-globs
Closed

zanieb wants to merge 8 commits into
mainfrom
zb/bughuntperf/213-workspace-exclude-globs

Conversation

@zanieb

@zanieb zanieb commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

Workspace discovery normalized, escaped, and recompiled every exclusion glob for every candidate member, multiplying work in large workspaces with long exclusion lists.

Centralize exclusion matching, initialize it only when a candidate needs checking, and reuse patterns already compiled while parsing pyproject.toml. Patterns that require normalization or absolute matching retain their existing behavior, including parent-directory exclusions and workspace roots containing glob characters.

Optimized microbenchmark with 512 members and nonmatching exclusions:

Exclusions Before After Improvement
64 168 ms 35 ms 4.8×
128 311 ms 126 ms 2.5×
256 934 ms 267 ms 3.5×
512 2,497 ms 683 ms 3.7×

@zanieb
zanieb marked this pull request as ready for review August 6, 2026 13:56
@astral-automations-bot

Copy link
Copy Markdown

Promoted to #20988.

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