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

Reorder vcs imports, to try more popular VCS systems sooner #10119

Closed
wants to merge 1 commit into from

Conversation

pradyunsg
Copy link
Member

Closes #7162, but using the check-order optimisation suggested there rather than via adding additional checks.

I don't think this is worth calling out in the changelog though.


This changes the order of vcs_backend in

for vcs_backend in self._registry.values():

$ # before
$ pip freeze
<pip._internal.vcs.bazaar.Bazaar object at 0x7f1a34c8cac0>
<pip._internal.vcs.git.Git object at 0x7f1a34c950a0>
<pip._internal.vcs.mercurial.Mercurial object at 0x7f1a34c954c0>
<pip._internal.vcs.subversion.Subversion object at 0x7f1a34c959a0>
$ # after
$ pip freeze
<pip._internal.vcs.git.Git object at 0x7f04ceceefa0>
<pip._internal.vcs.subversion.Subversion object at 0x7f04cecf4400>
<pip._internal.vcs.mercurial.Mercurial object at 0x7f04cecf48b0>
<pip._internal.vcs.bazaar.Bazaar object at 0x7f04cecf4c40>

This should help shave off a few 100ms in `pip freeze` runs when
the user has a VCS editable install, in the common cases.
@pradyunsg pradyunsg added type: enhancement Improvements to functionality C: vcs pip's interaction with version control systems like git, svn and bzr skip news Does not need a NEWS file entry (eg: trivial changes) labels Jul 2, 2021
@uranusjr
Copy link
Member

uranusjr commented Jul 5, 2021

What scenario does this improve and how much?

@pradyunsg
Copy link
Member Author

The scenario is elaborated upon in #7162. This should be ~130ms faster, based on that description, for that specific scenario.

That said, I'm not sure this is particularly valuable (which is why this has sat for so long with no updates). :)

@pradyunsg
Copy link
Member Author

Closing this out. If someone else wants to pick this up and benchmark it, please feel welcome to do so.

@pradyunsg pradyunsg closed this Jul 29, 2022
@pradyunsg pradyunsg deleted the reorder-vcs-imports branch July 29, 2022 12:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: vcs pip's interaction with version control systems like git, svn and bzr skip news Does not need a NEWS file entry (eg: trivial changes) type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vcs detection could be faster
2 participants