Bundle exec is 2x slower than using binstubs #1508

Closed
semaperepelitsa opened this Issue Oct 29, 2011 · 6 comments

3 participants

@semaperepelitsa

Running bundle exec rake --version is almost two times slower than running bin/rake --version. I tested this on both 1.0.21 and 1.1.rc. The RC results are also two times slower than the latest stable release results.

$ bundle -v
Bundler version 1.0.21
$ bundle > /dev/null; time bundle exec rake --version; time bin/rake --version
rake, version 0.9.2
bundle exec rake --version  3,87s user 0,50s system 98% cpu 4,436 total
rake, version 0.9.2
bin/rake --version  1,95s user 0,27s system 99% cpu 2,240 total

$ bundle -v
Bundler version 1.1.rc
$ bundle > /dev/null; time bundle exec rake --version; time bin/rake --version
rake, version 0.9.2
bundle exec rake --version  8,33s user 0,52s system 99% cpu 8,925 total
rake, version 0.9.2
bin/rake --version  4,19s user 0,28s system 96% cpu 4,622 total

What is causing this?

@semaperepelitsa

The same ratio on the Ruby 1.9.3-p0, but 2 times faster overall.

$ time bundle exec rake --version; time bin/rake --version
rake, version 0.9.2
bundle exec rake --version  1,69s user 0,19s system 86% cpu 2,173 total
rake, version 0.9.2
bin/rake --version  0,86s user 0,13s system 95% cpu 1,038 total
@indirect
Bundler member

Santiago wrote a performance fix for bundle exec here: 2c83825. That change has been released as part of 1.1 rc6, so if you could test and report back, that would be great. Thanks!

@semaperepelitsa

A performance regression seems to be fixed, but the difference between bundle exec and binstub remains about the same:

% bundle --version; time bundle exec rake --version; time bin/rake --version
Bundler version 1.1.rc.7
rake, version 0.9.2.2
bundle exec rake --version  2,38s user 0,26s system 82% cpu 3,204 total
rake, version 0.9.2.2
bin/rake --version  1,28s user 0,16s system 85% cpu 1,688 total
@indirect
Bundler member
@semaperepelitsa

No, 1.0 has the same difference.

@ilude ilude added a commit that referenced this issue Jan 15, 2012
@ilude ilude Fix for issue #1606 and #1508 with jruby and JRE 1.7. Also brings the…
… code inline with tenderlove's original gist.
a260df2
@ixti
Bundler member

Seems to be fixed:

bundle exec rspec  1.80s user 0.10s system 97% cpu 1.935 total
./bin/rspec  1.11s user 0.07s system 94% cpu 1.244 total
@ixti ixti closed this Aug 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment