require "benchmark" Benchmark.bm do |x| 5.times do x.report do 10000.times do o = Object.new def o.method; end end end end end user system total real 0.100000 0.000000 0.100000 ( 0.096522) 0.100000 0.000000 0.100000 ( 0.111413) 0.100000 0.000000 0.100000 ( 0.104038) 0.090000 0.000000 0.090000 ( 0.095231) 0.100000 0.000000 0.100000 ( 0.099539) user system total real 0.130000 0.000000 0.130000 ( 0.142741) 0.100000 0.000000 0.100000 ( 0.100665) 0.100000 0.010000 0.110000 ( 0.121455) 0.100000 0.000000 0.100000 ( 0.102085) 0.090000 0.000000 0.090000 ( 0.102203) require "benchmark" Benchmark.bm do |x| 5.times do x.report do 10000.times do o = Object.new class << o def method; end end end end end end user system total real 0.100000 0.010000 0.110000 ( 0.150145) 0.100000 0.000000 0.100000 ( 0.106283) 0.110000 0.000000 0.110000 ( 0.115765) 0.110000 0.000000 0.110000 ( 0.105696) 0.100000 0.000000 0.100000 ( 0.112317) user system total real 0.130000 0.000000 0.130000 ( 0.133677) 0.110000 0.010000 0.120000 ( 0.113726) 0.110000 0.000000 0.110000 ( 0.105676) 0.100000 0.000000 0.100000 ( 0.106207) 0.100000 0.000000 0.100000 ( 0.104637)