Skip to content

@wuputah /lambda-vs-array.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
require 'benchmark'
Benchmark.bmbm do |x|
x.report { 1_000_000.times { lambda { } } }
x.report { 1_000_000.times { Array.new } }
end
__END__
Rehearsal ------------------------------------
2.490000 0.740000 3.230000 ( 3.238588)
0.810000 0.080000 0.890000 ( 0.888949)
--------------------------- total: 4.120000sec
user system total real
2.390000 0.740000 3.130000 ( 3.137138)
0.390000 0.000000 0.390000 ( 0.389827)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.