Created
March 15, 2018 11:20
-
-
Save jonas-schulze/19f4e65fe1fa48fc4354cab7e3458f5d to your computer and use it in GitHub Desktop.
Ruby Performance Tricks -- 6 Years Later -- Trick 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
N = 10_000_000 | |
puts RUBY_DESCRIPTION | |
Benchmark.bm(15) do |x| | |
x.report('parallel') do | |
N.times do | |
a, b = 10, 20 | |
end | |
end | |
x.report('consequentially') do |x| | |
N.times do | |
a = 10 | |
b = 20 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment