Permalink
Browse files

Add profiling script

run this with ruby-prof
  • Loading branch information...
1 parent 1f6c0c5 commit 11155ca2903b21fd2f15d8ece72af1e0745414f5 @nahi committed Jan 13, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 bench/profile.rb
View
@@ -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.