mirror of
https://github.com/ruby/ruby.git
synced 2026-07-30 15:41:06 +08:00
Benchmark:
i = 0
def run(max)
i = 0
while i < max
a = i..100
i += 1
end
end
30.times { run(2) }
run(10_000_000)
Result:
Benchmark 1: master
Time (mean ± σ): 229.8 ms ± 3.2 ms [User: 221.7 ms, System: 6.2 ms]
Range (min … max): 226.3 ms … 235.2 ms 12 runs
Benchmark 2: branch
Time (mean ± σ): 67.4 ms ± 2.0 ms [User: 60.4 ms, System: 5.3 ms]
Range (min … max): 65.1 ms … 75.1 ms 43 runs
Summary
branch ran
3.41 ± 0.11 times faster than master