Skip to content
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

Add an in-memory cache for Git references #2682

Merged
merged 1 commit into from
Mar 27, 2024
Merged

Conversation

charliermarsh
Copy link
Member

Summary

Ensures that, even if we try to resolve the same Git reference twice within an invocation, it always returns a (cached) consistent result.

Closes #2673.

Test Plan

❯ cargo run pip install git+https://github.com/pallets/flask.git --reinstall --no-cache
   Compiling uv-distribution v0.0.1 (/Users/crmarsh/workspace/uv/crates/uv-distribution)
   Compiling uv-resolver v0.0.1 (/Users/crmarsh/workspace/uv/crates/uv-resolver)
   Compiling uv-installer v0.0.1 (/Users/crmarsh/workspace/uv/crates/uv-installer)
   Compiling uv-dispatch v0.0.1 (/Users/crmarsh/workspace/uv/crates/uv-dispatch)
   Compiling uv-requirements v0.1.0 (/Users/crmarsh/workspace/uv/crates/uv-requirements)
   Compiling uv v0.1.24 (/Users/crmarsh/workspace/uv/crates/uv)
    Finished dev [unoptimized + debuginfo] target(s) in 3.95s
     Running `target/debug/uv pip install 'git+https://github.com/pallets/flask.git' --reinstall --no-cache`
 Updated https://github.com/pallets/flask.git (b90a4f1)
Resolved 7 packages in 280ms
   Built flask @ git+https://github.com/pallets/flask.git@b90a4f1f4a370e92054b9cc9db0efcb864f87ebe                                                                                                                                            Downloaded 7 packages in 212ms
Installed 7 packages in 9ms

@charliermarsh charliermarsh added the performance Potential performance improvement label Mar 27, 2024
@charliermarsh charliermarsh marked this pull request as ready for review March 27, 2024 01:28
@charliermarsh charliermarsh enabled auto-merge (squash) March 27, 2024 01:31
@charliermarsh charliermarsh merged commit ffd78d0 into main Mar 27, 2024
31 checks passed
@charliermarsh charliermarsh deleted the charlie/double-git branch March 27, 2024 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Potential performance improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Git SHAs are resolved twice when used as direct references
1 participant