/ bundler

Speed up bundle install

TL;DR Next time, when you need bundle install, do bundle install --jobs X, where X is the number of your machine cores. It will save you huge amount of time.

Some blog suggests that setting the number of jobs to X-1 is statistically better than X. But that is not true anymore, at least with bundler >= 1.7.12. To prove this, I tested it on a large Rails project (discourse) on my Mid 2012 MBP with 2.6 GHz Intel Core i7. Below is my test result:

  • bundle install takes 13 mins and 45 seconds
  • bundle install --jobs 7 takes 3 mins and 51 seconds
  • bundle install --jobs 8 takes 3 mins and 47 seconds

Although the difference between 7 and 8 jobs is not big, using more jobs is still faster. Other benchmark has similar result.

To save some typing, I would recommend configing this option globally on your machine, e.g. bundle config --global jobs X. After this, you only need to do bundle install

Life is too short. Speed up bundle install.

Speed up bundle install
Share this