Commit 9fed28ad5ca87f09a14cdc304e68700f53610522
simple_skiplist benchmark updated
| |   |
| 50 | 50 | |
| 51 | 51 | puts |
| 52 | 52 | puts "Find/insert techniques" |
| Benchmark.bm(32) do |x| |
| Benchmark.bm(42) do |x| |
| 54 | 54 | langs = [:C] if RUBY_PLATFORM !~ /java/ |
| 55 | 55 | langs = [:Java] if RUBY_PLATFORM =~ /java/ |
| 56 | 56 | SimpleSkiplist.with_optimizations(langs) do |lang| |
| 57 | 57 | GC.start |
| x.report("SimpleSkiplist#find #{lang}".ljust(32)) do |
| 100.times do |
| x.report("SimpleSkiplist#find 5000 #{lang}".ljust(32)) do |
| 1000.times do |
| 60 | 60 | key = rand(len).to_s |
| 61 | 61 | biglist.find(key) |
| 62 | 62 | biglist.find(key) |
| … | … | |
| 66 | 66 | end |
| 67 | 67 | end |
| 68 | 68 | GC.start |
| x.report("SimpleSkiplist#insert #{lang}".ljust(32)) do |
| 100.times do |
| x.report("SimpleSkiplist#insert 5000 #{lang}".ljust(32)) do |
| 1000.times do |
| 71 | 71 | key = rand(len).to_s |
| 72 | 72 | biglist.insert(key, key) |
| 73 | 73 | key = rand(len).to_s |