Skip to content

Commit

Permalink
add some benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
rdp committed Dec 31, 2009
1 parent 9119199 commit 496fed8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
20 changes: 20 additions & 0 deletions benchmarks/benchmark.rb
@@ -0,0 +1,20 @@
require 'ruby-prof'
require 'benchmark'

def go
end

puts Benchmark.realtime {
RubyProf.profile do
100000.times { go }
end
}

for n in [5, 100] do
n.times { Thread.new { sleep }}
puts Benchmark.realtime {
RubyProf.profile do
100000.times { go }
end
}
end
18 changes: 18 additions & 0 deletions benchmarks/benchmark.rb~
@@ -0,0 +1,18 @@
require 'ruby-prof'
require 'benchmark'

def go
end

puts Benchmark.realtime {
RubyProf.profile do
100000.times { go }
end
}

100.times { Thread.new { sleep }}
puts Benchmark.realtime {
RubyProf.profile do
100000.times { go }
end
}

0 comments on commit 496fed8

Please sign in to comment.