Created
July 7, 2014 07:20
-
-
Save makaroni4/fc157a4caf7cd1baef0d to your computer and use it in GitHub Desktop.
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/ips' | |
Benchmark.ips do |r| | |
r.report("mass") do | |
a, b, c, d = 1, 2, 3, 4 | |
end | |
r.report("step by step") do | |
a = 1 | |
b = 2 | |
c = 3 | |
d = 4 | |
end | |
end | |
# Calculating ------------------------------------- | |
# mass 66174 i/100ms | |
# step by step 96824 i/100ms | |
# ------------------------------------------------- | |
# mass 3398229.4 (±34.4%) i/s - 13962714 in 5.006538s | |
# step by step 6655682.5 (±5.3%) i/s - 33210632 in 5.009689s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment