Skip to content

Instantly share code, notes, and snippets.

@savonarola
Created January 28, 2011 22:29
Show Gist options
  • Save savonarola/801131 to your computer and use it in GitHub Desktop.
Save savonarola/801131 to your computer and use it in GitHub Desktop.
require 'perl'
require 'benchmark'
n1 = 1000000;
n2 = 10000;
perl = Perl.new
perl.eval "use Foo; use Bar;"
Benchmark.bm(20) do |x|
x.report("empty:") do
1.upto(n1) do
perl.call "Foo::bar"
end
end
x.report("withdb:") do
1.upto(n2) do
perl.call "Bar::rnd"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment