bundler/bundler — pull request #2481 by eagletmt (2013-05-23 04:50:24+00:00)
Title: Parallel installation

I parallelized gem installation. It mainly improves initial `bundle install` speed.

I added a new option `-j` which specifies the number of jobs to run in parallel.
The parallelization mechanism is normally multi-process using `fork`, but it switches to multi-thread on Windows because it doesn't have `fork`. Multi-thread version is slower than multi-process version due to locking about `Dir.chdir`.

At one project, which have over 200 gems to be installed, initial `bundle -j4` is faster than `bundle` by about four minutes.

```
bundle --path sequential 183.03s user 45.13s system 38% cpu 9:55.48 total
bundle --path parallel -j4 234.85s user 50.14s system 77% cpu 6:05.52 total
```