Skip to content

Commit

Permalink
Add profiling script
Browse files Browse the repository at this point in the history
run this with ruby-prof
  • Loading branch information
Hiroshi Nakamura committed Jan 13, 2012
1 parent 1f6c0c5 commit 11155ca
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bench/profile.rb
@@ -0,0 +1,13 @@
require File.expand_path('../lib/avl_tree', File.dirname(__FILE__))

random = Random.new(0)

TIMES = 200000
key_size = 10

h = AVLTree.new
TIMES.times do
h[random.bytes(key_size)] = 1
h[random.bytes(key_size)]
h.delete(random.bytes(key_size))
end

0 comments on commit 11155ca

Please sign in to comment.