Skip to content

Add an in-memory cache for Git references#2682

Merged
charliermarsh merged 1 commit intomainfrom
charlie/double-git
Mar 27, 2024
Merged

Add an in-memory cache for Git references#2682
charliermarsh merged 1 commit intomainfrom
charlie/double-git

Conversation

@charliermarsh
Copy link
Copy Markdown
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
@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