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

Speed up bundle install when gems did not change #99

Closed
wants to merge 1 commit into from
Closed

Speed up bundle install when gems did not change #99

wants to merge 1 commit into from

Conversation

vassilevsky
Copy link
Contributor

Hello everyone!

Bundler has the --local flag that disables expensive network requests. Makes sense to try it first.

If gems are not yet installed on the server, it will fail. In this case, the "normal" command will be executed. It will download new gems.

The drawback of this solution is that the local command is not printed. Doesn't look like a big deal though. The "normal" command is printed. Please do let me know if it's better to print the original as well, and how, because I don't have a clear idea.

I have tested this change on a real project. Deployment time dropped by ~20 seconds. The server is in Moscow.

@capistrano-bot
Copy link

capistrano-bot commented Oct 26, 2017

Thanks for the PR! This project lacks automated tests, which makes reviewing and approving PRs somewhat difficult. Please make sure that your contribution has not broken backwards compatibility or introduced any risky changes.

Generated by 🚫 Danger

Bundler has the `--local` flag that disables expensive network requests.
Makes sense to try it first.

If gems are not yet installed on the server, it will fail. In this case,
the "normal" command will be executed. It will download new gems.
@vassilevsky
Copy link
Contributor Author

I have discovered #95 and realised that this PR is not necessary.

I have collected some timings from the commands. The project has 264 gems in total. All commands ran on the bundle directory that already contained all required gems (from previous installs).

bundle install --path /path/to/project/shared/bundle --without development test --deployment --quiet         # 30.127s
bundle install --path /path/to/project/shared/bundle --without development test --deployment --quiet --local #  4.540s
bundle check --path /path/to/project/shared/bundle                                                           #  1.794s

So bundle check is clearly the winner here. Making it work is the way to go.

@vassilevsky vassilevsky deleted the faster-install branch October 26, 2017 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants