You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The subprocess call to the vcs tool takes some time. Calling hg appears to be a little slower than calling git (on my widows machine). git rev-parse takes around 60mS hg identify takes around 130mS
Perhaps it would be preferable to avoid (where possible) calling each vcs tool until the correct one is found. Rather using directory inspection for ALL vcs types first and falling back to calling vcs tools if inspection finds nothing.
With this in mind, would the following be a better approach for VcsSupport.get_backend_for_dir()?
Search every directory up the directory tree for a .git/.hg/.svn/.bzr directory.
if one is found then assume that is the vcs type, i.e if .git directory is found then vcs is assumed to be git without calling the vcs tool.
If no .git/.hg/.svn/.bzr directory is found, then call each vcs tool that implements controls_location() until one reports that it controls the location.
Another optimization: Make the order of vcs tools deterministic, putting the most popular tools first. Currently they are kept in a dict, so the order that they are tried can vary from system to system.
The text was updated successfully, but these errors were encountered:
#7072 has highlighted that the current approach to detecting which vcs tool to use for editable packages could be made faster.
Currently the method used by
VcsSupport.get_backend_for_dir()
is:git
implemented this call. Fix pip freeze not showing correct entry for mercurial packages that use subdirectories. #7072 adds ahg
call.The subprocess call to the vcs tool takes some time. Calling
hg
appears to be a little slower than callinggit
(on my widows machine).git rev-parse
takes around 60mShg identify
takes around 130mSPerhaps it would be preferable to avoid (where possible) calling each vcs tool until the correct one is found. Rather using directory inspection for ALL vcs types first and falling back to calling vcs tools if inspection finds nothing.
With this in mind, would the following be a better approach for
VcsSupport.get_backend_for_dir()
?.git
directory is found then vcs is assumed to begit
without calling the vcs tool.controls_location()
until one reports that it controls the location.Another optimization: Make the order of vcs tools deterministic, putting the most popular tools first. Currently they are kept in a dict, so the order that they are tried can vary from system to system.
The text was updated successfully, but these errors were encountered: