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

Improve performance of the Bazaar VCS backend #5445

Closed
wants to merge 3 commits into from

Conversation

jelmer
Copy link
Contributor

@jelmer jelmer commented May 26, 2018

Improve performance of the Bazaar VCS backend:

  • Use lightweight checkouts rather than a full branch clone
  • Export directly from the remote branch

This significantly improves performance for Bazaar branches. E.g. for installing bzr itself ("bzr+lp:bzr"):

Performance on my system for 'bzr co --lightweight lp:bzr':

 0.60s user 0.11s system 5% cpu 12.234 total

Performance on my system for 'bzr branch lp:bzr' (current behaviour):

 65.41s user 1.48s system 39% cpu 2:47.91 total

Fixes #5443
Fixes #5444

@RonnyPfannschmidt
Copy link
Contributor

the failing build was a travis issue, i restarted the offending element

@pradyunsg
Copy link
Member

Looks like the same as git's --depth parameter and related discussion.

@pradyunsg pradyunsg added type: enhancement Improvements to functionality C: vcs pip's interaction with version control systems like git, svn and bzr state: needs discussion This needs some more discussion labels May 30, 2018
@jelmer
Copy link
Contributor Author

jelmer commented May 30, 2018

A distinction between git's --depth parameter and bzr's lightweight checkouts is that history in bzr's case is not truncated; any access of history (which should be rare) will result in bzr contacting the remote repository to retrieve the missing history (lazily).

@RonnyPfannschmidt
Copy link
Contributor

@pradyunsg basically gits '--depth' is a half-assed feature that breaks half the world, while bzr pretty much did light checkouts correctly

@pradyunsg
Copy link
Member

@jelmer Could you link to the issues that this PR should close (using the GitHub auto close 'magic')?

(on mobile)

@jelmer
Copy link
Contributor Author

jelmer commented Jun 23, 2018

Done.

@pradyunsg
Copy link
Member

FYI - linter check is failing.

@jelmer
Copy link
Contributor Author

jelmer commented Jun 23, 2018

Sorry, fixed now.

@BrownTruck
Copy link
Contributor

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will eligible for code review and hopefully merging!

@BrownTruck BrownTruck added the needs rebase or merge PR has conflicts with current master label Jul 9, 2018
@pypa-bot pypa-bot removed the needs rebase or merge PR has conflicts with current master label Jul 9, 2018
@jelmer
Copy link
Contributor Author

jelmer commented Jul 31, 2018

Done.

@BrownTruck
Copy link
Contributor

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will eligible for code review and hopefully merging!

@BrownTruck BrownTruck added the needs rebase or merge PR has conflicts with current master label Aug 17, 2018
@pypa-bot pypa-bot removed the needs rebase or merge PR has conflicts with current master label Aug 17, 2018
@jelmer
Copy link
Contributor Author

jelmer commented Aug 18, 2018

Thanks, cjerdonek. Is there anything I can do to help get this merged? upstream keeps changing under me.

@pradyunsg pradyunsg removed the state: needs discussion This needs some more discussion label Aug 18, 2018
@BrownTruck
Copy link
Contributor

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will be eligible for code review and hopefully merging!

@BrownTruck BrownTruck added the needs rebase or merge PR has conflicts with current master label Sep 27, 2018
jelmer and others added 2 commits September 27, 2018 23:45
* Use lightweight checkouts rather than a full branch clone
* Export directly from the remote branch

Fixes pypa#5444, pypa#5443
@pypa-bot pypa-bot removed the needs rebase or merge PR has conflicts with current master label Sep 27, 2018
@jelmer
Copy link
Contributor Author

jelmer commented Sep 27, 2018

ping, any news on this?

@pradyunsg
Copy link
Member

Thanks @jelmer for being so patient!

@cjerdonek could you please take a look at this?

@jelmer
Copy link
Contributor Author

jelmer commented Jan 1, 2019

ping @cjerdonek

@cjerdonek
Copy link
Member

Here are some high-level comments on this PR. My apologies for not taking a look sooner, but I've never used Bazaar, so I felt like I might not be qualified to review the PR. My comments below are merely high-level.

  • This PR changes three different operations for the Bazaar VCS: export(), fetch_new(), and update(). I think they should be proposed and considered separately since the rationale and decision may be different for each, and they may each require different tests, etc.

  • For each change there should be at least one test to make sure the code still works with the change. It's possible there aren't yet any functional tests using Bazaar.

  • The news files have extension .bugfix, but these are performance enhancements and so should be marked .feature.

  • One of the proposed changes here is to do lightweight checkouts, but for consistency reasons it doesn't seem like we should be doing this for Bazaar if we're not going to do it for Git. And for Git, this idea (shallow clones) was already rejected in the past here: git checkout could/should be done with --depth=1 #2432

@jelmer
Copy link
Contributor Author

jelmer commented Jan 6, 2019

As discussed earlier in this pull request, lightweight checkouts in bzr are different from shallow checkouts in Git and the considerations for dropping git shallow clones don't apply here:

A distinction between git's --depth parameter and bzr's lightweight checkouts is that history in bzr's case is not truncated; any access of history (which should be rare) will result in bzr contacting the remote repository to retrieve the missing history (lazily).

I'll see if I can split up this pull request into two separate ones.

@jelmer
Copy link
Contributor Author

jelmer commented Jan 15, 2019

I've split the export part out into a separate proposal: #6139

@BrownTruck
Copy link
Contributor

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will be eligible for code review and hopefully merging!

@BrownTruck BrownTruck added the needs rebase or merge PR has conflicts with current master label Mar 1, 2019
@pradyunsg
Copy link
Member

Closing this since it's bitrotten. Please file a new PR if there's still interest in this.

@pradyunsg pradyunsg closed this May 23, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 22, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: vcs pip's interaction with version control systems like git, svn and bzr needs rebase or merge PR has conflicts with current master type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exporting remote Bazaar branch creates unnecessary clone Checking out Bazaar branch makes full clone
6 participants