Skip to content

Avoid repeated workspace-member lookups during discovery#281

Draft
zaniebot wants to merge 1 commit into
mainfrom
zb/bughuntperf/264-workspace-member-path-lookup
Draft

Avoid repeated workspace-member lookups during discovery#281
zaniebot wants to merge 1 commit into
mainfrom
zb/bughuntperf/264-workspace-member-path-lookup

Conversation

@zaniebot

@zaniebot zaniebot commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Repeated cached workspace discovery scans every workspace member to recover the package name for each member path. Commands that discover many members in a wide workspace therefore do quadratic path-comparison work even though the workspace cache is already keyed by those paths.

Cache each workspace member's name with its path, preserving the discovery behavior established in uv#18311 and uv#20363.

Performance

An optimized, CPU-pinned Namespace size sweep (x86_64 AMD EPYC, 16 vCPU, Rust 1.96.1; median of three runs) uses equally sized member and lookup sets. The indexed result includes building the path index.

Members / lookups Full scan Indexed lookup Improvement
256 0.855 ms 0.013 ms 67x
1,024 13.709 ms 0.052 ms 266x
4,096 218.895 ms 0.294 ms 745x
8,192 877.206 ms 0.651 ms 1,347x

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.

2 participants