Skip to content
This repository
Browse code

move benchmarks to script directory

  • Loading branch information...
commit 0f243f64af787f82fde0f79153c4d82cc3989e33 1 parent 6360d4e
Daniel Mendler authored January 05, 2013
3  .gitignore
@@ -6,6 +6,5 @@ spec/tmp
6 6
 *.swp
7 7
 *.rdb
8 8
 .#*
9  
-benchmarks/*.histogram
10  
-benchmarks/bench.*
  9
+script/benchmarks.tmp
11 10
 Gemfile.lock
3  Rakefile
@@ -67,8 +67,7 @@ task :test do
67 67
 end
68 68
 
69 69
 task :benchmarks do
70  
-  Dir.chdir('benchmarks')
71  
-  ruby("run.rb #{ENV['CONFIG']}")
  70
+  ruby("script/benchmarks #{ENV['CONFIG']}")
72 71
 end
73 72
 
74 73
 task :default => :test
28  benchmarks/run.rb → script/benchmarks 100644 → 100755
@@ -3,37 +3,41 @@
3 3
 $: << File.join(File.dirname(__FILE__), '..', 'lib')
4 4
 require 'benchmark'
5 5
 require 'moneta'
  6
+require 'fileutils'
  7
+
  8
+DIR = __FILE__ + '.tmp'
  9
+FileUtils.mkpath(DIR)
6 10
 
7 11
 STORES = {
8 12
   # SDBM is unstable
9  
-  # :SDBM => { :file => 'bench.sdbm' },
  13
+  # :SDBM => { :file => "#{DIR}/sdbm" },
10 14
   # YAML is so fucking slow
11  
-  # :YAML => { :file => 'bench.yaml' },
  15
+  # :YAML => { :file => "#{DIR}/yaml" },
12 16
   :ActiveRecord => { :connection => { :adapter  => 'sqlite3', :database => ':memory:' } },
13 17
   :Cassandra => {},
14 18
   :Client => {},
15 19
   :Couch => {},
16  
-  :DBM => { :file => 'bench.dbm' },
17  
-  :DataMapper => { :setup => 'sqlite3:bench.datamapper' },
18  
-  :Daybreak => { :file => 'bench.daybreak' },
19  
-  :File => { :dir => 'bench.file' },
20  
-  :GDBM => { :file => 'bench.gdbm' },
  20
+  :DBM => { :file => "#{DIR}/dbm" },
  21
+  :DataMapper => { :setup => "sqlite3:#{DIR}/datamapper" },
  22
+  :Daybreak => { :file => "#{DIR}/daybreak" },
  23
+  :File => { :dir => "#{DIR}/file" },
  24
+  :GDBM => { :file => "#{DIR}/gdbm" },
21 25
   :HBase => {},
22  
-  :HashFile => { :dir => 'bench.hashfile' },
  26
+  :HashFile => { :dir => "#{DIR}/hashfile" },
23 27
   :LRUHash => {},
24  
-  :LevelDB => { :dir => 'bench.leveldb' },
25  
-  :LocalMemCache => { :file => 'bench.lmc' },
  28
+  :LevelDB => { :dir => "#{DIR}/leveldb" },
  29
+  :LocalMemCache => { :file => "#{DIR}/lmc" },
26 30
   :MemcachedDalli => {},
27 31
   :MemcachedNative => {},
28 32
   :Memory => {},
29 33
   :Mongo => {},
30  
-  :PStore => { :file => 'bench.pstore' },
  34
+  :PStore => { :file => "#{DIR}/pstore" },
31 35
   :Redis => {},
32 36
   :RestClient => { :url => 'http://localhost:8808/' },
33 37
   :Riak => {},
34 38
   :Sequel => { :db => 'sqlite:/' },
35 39
   :Sqlite => { :file => ':memory:' },
36  
-  :TDB => { :file => 'bench.tdb' },
  40
+  :TDB => { :file => "#{DIR}/tdb" },
37 41
 }
38 42
 
39 43
 CONFIGS = {

0 notes on commit 0f243f6

Please sign in to comment.
Something went wrong with that request. Please try again.