public
Created

  • Download Gist
results.txt
1 2 3 4 5 6 7
$ ruby test.rb
Calculating -------------------------------------
success 51960 i/100ms
failure 4653 i/100ms
-------------------------------------------------
success 2687778.5 (±3.7%) i/s - 13405680 in 4.996239s
failure 53863.7 (±3.5%) i/s - 269874 in 5.016999s
test.rb
Ruby
1 2 3 4 5 6 7 8 9
require 'benchmark/ips'
 
o = Object.new
id = o.__id__
 
Benchmark.ips do |r|
r.report('success') { ObjectSpace._id2ref(id) rescue nil }
r.report('failure') { ObjectSpace._id2ref(6) rescue nil }
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.