Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

bundle install: don't re-download specs for installed gems #2680

Merged
merged 1 commit into from
Oct 21, 2013

Conversation

cainlevy
Copy link
Contributor

This proposal significantly improves bundle install performance when most (but not all) gems have already been installed. It eliminates a couple network roundtrips for the gems that are already installed. These roundtrips are to fetch a fresh copy of the spec for each gem.

With this patch, running bundle install on my gem set (~200 gems) on my home cable+wifi reduced the run time by 60%, from ~80s to ~30s.

The logic in question appears to originate from 500d94d, four years ago. The current comments don't mention any details about what might be "broken and wrong", and I don't know much about the historical context. One clue may be in a comment for the underlying __swap__ method, which mentions Rubyforge.

When I tried removing the line entirely, many specs broke. Could this be a test harness / teardown issue? Or is it related to why the logic exists?

In any case, moving the line into Bundler::Source::Rubygems (the only source it affects) allows the specs to pass while also reducing its frequency so it only runs for gems that need to be installed. This seems like the simplest change with the biggest benefit.

@vipulnsward
Copy link

💯

@jricketson
Copy link

I have been seeing this problem as well, whenever the gemfile has changed. It changes the bundling performance from seconds to minutes.

indirect added a commit that referenced this pull request Oct 21, 2013
bundle install: don't re-download specs for installed gems
@indirect indirect merged commit 33208e2 into rubygems:master Oct 21, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants