speed difference between bundle exec ruby vs ruby -rbundler/setup #2117

Closed
grosser opened this Issue Oct 6, 2012 · 4 comments

3 participants

@grosser

Just did some testing a a big app, and turns out that

time bundle exec ruby -e '' == 4s
time ruby -rbundler/setup -e '' == 2.3s

Afaik they should be doing almost the same, maybe it's possible to save those 1.7 seconds via early stopping inside of bundler ?

@indirect
Bundler member
@grosser

How about:

# bin/bundle
if ARGV[0..1] == ["exec", "ruby"]
  exec "ruby -rbundler/setup #{ARGV.join(' ')}"
else
  ...
end
@indirect
Bundler member
@xaviershay

Patch still welcome (still an issue), but not a bug and small enough issue that I'm not going to keep this open.

> time ruby -rbundler/setup -e 'puts "foo"'
foo
ruby -rbundler/setup -e 'puts "foo"'  0.46s user 0.09s system 96% cpu 0.574 total
> time bundle exec ruby -e 'puts "foo"'
foo
bundle exec ruby -e 'puts "foo"'  0.71s user 0.13s system 95% cpu 0.877 total
@xaviershay xaviershay closed this Aug 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment