Skip to content

Commit

Permalink
Make it work on 1.8
Browse files Browse the repository at this point in the history
Use OpenSSL::Random instead of Random#bytes
  • Loading branch information
Hiroshi Nakamura committed Jan 16, 2012
1 parent 067f953 commit 551e9f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bench/bench.rb
@@ -1,8 +1,9 @@
require 'benchmark'
require 'radix_tree' # gem install radix_tree
require 'avl_tree'
require 'openssl'

random = Random.new(0)
#random = Random.new(0)

TIMES = 100000
key_size = 10
Expand Down Expand Up @@ -40,7 +41,7 @@ def run(bm, h, keys)

keys = []
TIMES.times do
keys << random.bytes(key_size)
keys << OpenSSL::Random.random_bytes(key_size)
end

Benchmark.bmbm do |bm|
Expand Down

0 comments on commit 551e9f0

Please sign in to comment.