Skip to content
This repository
tag: 1.3.0
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 14 lines (12 sloc) 0.308 kb
1 2 3 4 5 6 7 8 9 10 11 12 13
require 'benchmark'

(ARGV[0] || 1).to_i.times do
  Benchmark.bm(40) do |bm|
    bm.report("1M calls to obj.object_id") do
      o = Object.new
      1_000_000.times { o.object_id }
    end
    bm.report("1M calls to Object.new.object_id") do
      1_000_000.times { Object.new.object_id }
    end
  end
end
Something went wrong with that request. Please try again.