Avoid sharing version metadata across indexes#18373
Merged
charliermarsh merged 2 commits intomainfrom Mar 10, 2026
Merged
Conversation
Member
Author
|
(This has a few problems hence the failing tests but I think it’s directionally correct…) |
konstin
approved these changes
Mar 10, 2026
konstin
added a commit
that referenced
this pull request
Mar 15, 2026
Improve the performance for #18373. ``` $ hyperfine --warmup 3 --runs 30 \ '/tmp/uv-0-baseline lock --project /home/konsti/projects/airflow' \ '/tmp/uv-1-or-insert-with lock --project /home/konsti/projects/airflow' \ '/tmp/uv-2-single-lookup lock --project /home/konsti/projects/airflow' \ Benchmark 1: /tmp/uv-0-baseline lock --project /home/konsti/projects/airflow Time (mean ± σ): 147.1 ms ± 10.1 ms [User: 108.4 ms, System: 23.6 ms] Range (min … max): 130.5 ms … 165.9 ms 30 runs Benchmark 2: /tmp/uv-1-or-insert-with lock --project /home/konsti/projects/airflow Time (mean ± σ): 141.3 ms ± 7.3 ms [User: 106.3 ms, System: 21.3 ms] Range (min … max): 131.5 ms … 160.6 ms 30 runs Benchmark 3: /tmp/uv-2-single-lookup lock --project /home/konsti/projects/airflow Time (mean ± σ): 139.6 ms ± 7.3 ms [User: 104.7 ms, System: 21.8 ms] Range (min … max): 128.3 ms … 160.9 ms 30 runs Summary /tmp/uv-2-single-lookup lock --project /home/konsti/projects/airflow ran 1.01 ± 0.07 times faster than /tmp/uv-1-or-insert-with lock --project /home/konsti/projects/airflow 1.05 ± 0.09 times faster than /tmp/uv-0-baseline lock --project /home/konsti/projects/airflow ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The metadata cache used
VersionIdas a key, which meant that if a package-version existed on two different indexes, we assumed identical metadata. This turns out not to be true in some contexts, e.g., for the linked issue with PyTorch. We now key it onDistributionId, which does include the index.Closes #17732.