Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 769f84776c
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (33 sloc) 0.457 kb
class Foo
def uno
tres if respond_to?(:tres)
end
def dos
tres
rescue NameError
end
def none
tres
end
def tres
3
end
def method_missing(meth, *args)
end
end
require "rubygems"
require "rbench"
FOO = Foo.new
(ARGV[0] || 1).to_i.times do
RBench.run(1_000_000) do
report("respond_to?") do
FOO.uno
end
report("blind run") do
FOO.none
end
report("blind run and rescue") do
FOO.dos
end
end
end
Jump to Line
Something went wrong with that request. Please try again.