summitpush / performance-tests

Some code I was playing around with to benchmark different ruby interpreters

This URL has Read+Write access

performance-tests / recurse.rb
100644 15 lines (12 sloc) 0.218 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'benchmark'
 
def recurse(num)
  return 0 if (num == 0)
  1.upto(10) { |i| recurse(num - 1)}
end
 
Benchmark.bm(40) do |bm|
  5.times do
    bm.report("recursion benchmark") do
      recurse(6)
    end
  end
end