Profile Poetry identification and avoid whole-inventory cloning with an alias index
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
- 领域
- performance
调研方向
Start with crates/pet-poetry/src/lib.rs at find_with_cache and try_from, then use the scale fixtures from #533 and ownership guidance from #536. Measure identification, allocation, operation counts, and timings across representative inventory sizes before choosing whether indexing is justified. Done means evidence-backed behavior tests preserve alias, symlink, workspace, refresh, and invalidation semantics, or document a measured deferral.
由索引模型根据 Issue 内容生成。
描述
Tracking plan: #528
Priority: P3, measurement-gated optimization. Evidence: cloning/linear scan confirmed; end-user latency impact not yet profiled.
Problem
Poetry's cached discovery lookup clones the complete LocatorResult, including all environments, and try_from then scans that result and its symlinks for each candidate. At larger inventories this can produce repeated whole-inventory allocation and candidate-by-environment work. Cold concurrent callers can also repeat cache population work.
Sources: find_with_cache, try_from.
Scope
First measure identification and allocation/operation counts over representative Poetry inventory sizes using deterministic fixtures. If material, share immutable discovery results and index executables/aliases for direct lookup. Reuse existing per-key single-flight machinery where appropriate instead of adding another cache framework.
Preserve Poetry-versus-generic-venv precedence, prefix/project/manager fidelity, platform path semantics, and the full/workspace/kind-filtered refresh-state merge contract. Do not introduce broad cross-refresh cache persistence without an invalidation design.
Acceptance criteria
- The issue records before/after operation or allocation counts and timings across multiple inventory sizes; any optimization claim is tied to evidence.
- If indexing is justified, repeated identification no longer clones/scans the entire inventory for each candidate.
- Alias/case/symlink identity, workspace association, manager details, refresh merging, and configuration invalidation have behavior tests.
- Concurrent cache misses avoid unnecessary duplicate work without deadlocking or permanently caching failures.
- Small-inventory latency and memory do not materially regress under #531/#533.
- If the measured benefit is negligible, close with measurements and a documented deferral instead of landing complexity solely to remove clones.
Dependencies
Depends on #533 for scale fixtures and #536 for stable cache/snapshot ownership. This is deliberately after the reproduced process/transport failures; do not treat it as the first performance fix.
- 主要语言
- Rust
- 星标
- 207
- 派生
- 45
- 平均合并
- 8 小时 19 分钟
- 30 天内合并 PR
- 2
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/python-environment-tools 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/python-environment-tools#525 · 1 条评论 ·
-
debt
难度 5/5 一周以上 新手友好度 25/100
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
-
debt
难度 5/5 一周以上 新手友好度 35/100
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
查看 microsoft/python-environment-tools 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
issue
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 88/100
web-infra-dev/rspack#15847 ·