Skip to content

Instantly share code, notes, and snippets.

@wycats
Created November 25, 2008 23:02
Show Gist options
  • Save wycats/29153 to your computer and use it in GitHub Desktop.
Save wycats/29153 to your computer and use it in GitHub Desktop.
require "rubygems"
require "rbench"
module Foo
module Bar
module Baz
end
end
end
3_000_000.times do
Foo
::Foo
Foo::Bar::Baz
::Foo::Bar::Baz
end
RBench.run(1_000_000) do
report("single") { Foo }
report("single colon3") { ::Foo }
report("colon2") { Foo::Bar::Baz }
report("colon3") { ::Foo::Bar::Baz }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment