Permalink
Browse files

added search benchmark

  • Loading branch information...
1 parent 85417a0 commit e208d671208182cb6466672882626335217e073b Oleg Andreev committed Jun 14, 2008
Showing with 25 additions and 0 deletions.
  1. +25 −0 meta/benchmarks/search.rb
View
@@ -0,0 +1,25 @@
+$:.unshift File.dirname(__FILE__) + "/../../lib"
+require 'strokedb'
+include StrokeDB
+
+require 'benchmark'
+include Benchmark
+
+FileUtils.rm_rf "../../spec/temp/storages/search_bench"
+StrokeDB::Config.build :default => true, :base_path => "../../spec/temp/storages/search_bench"
+
+Skiplist.optimize!(:C)
+
+puts "before Meta.new"
+User = Meta.new
+puts "before User.create!"
+1.times {|i| User.create! :i => i }
+puts "before User.find"
+# Benchmark.bm(17) do |x|
+# GC.start
+# x.report("Search ") do
+ 1.times do
+ User.find :i => 2
+ end
+# end
+# end

0 comments on commit e208d67

Please sign in to comment.