Skip to content

Instantly share code, notes, and snippets.

@fcheung
Created June 4, 2020 20:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcheung/43d584c70707407cf61998437a61a772 to your computer and use it in GitHub Desktop.
Save fcheung/43d584c70707407cf61998437a61a772 to your computer and use it in GitHub Desktop.
binstub vs bundle exec
require 'benchmark/ips'
Benchmark.ips do |x|
x.config(time: 60, warmup: 5)
x.config(stats: :bootstrap, confidence: 95)
x.report('binstub') { `bin/rspec -v`}
x.report('bundle exec') {`bundle exec rspec -v `}
x.report('direct') {`rspec -v `}
end
Warming up --------------------------------------
binstub 1.000 i/100ms
bundle exec 1.000 i/100ms
direct 1.000 i/100ms
Calculating -------------------------------------
1.608 (± 1.1%) i/s - 97.000 in 60.534547s
1.477 (± 0.6%) i/s - 89.000 in 60.315969s
2.828 (± 0.8%) i/s - 170.000 in 60.313360s
with 95.0% confidence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment