Permalink
Browse files

add voldemort benchmark

  • Loading branch information...
1 parent 12f43a0 commit 986acba629655e04c771cd7de84d385b68d8332e @actsasflinn committed Mar 15, 2010
Showing with 22 additions and 0 deletions.
  1. +22 −0 benchmarks/db.rb
View
@@ -33,6 +33,12 @@
user system total real
inserting data 1.200000 0.210000 1.410000 ( 2.329328)
reading data 1.510000 0.220000 1.730000 ( 2.721509)
+
+
+Voldemort (Ruby)
+ user system total real
+inserting data 18.290000 1.050000 19.340000 ( 37.562370)
+reading data 9.040000 0.530000 9.570000 ( 15.145843)
=end
require 'benchmark'
@@ -149,3 +155,19 @@
data.each_with_index { |e, i| nothing = mc.get(i.to_s) }
end
end
+
+require 'voldemort-rb'
+vdb = VoldemortClient.new("test", "localhost:6666")
+2.times { puts }
+puts 'Voldemort (Ruby)'
+
+Benchmark.benchmark(' ' * 20 + Benchmark::Tms::CAPTION, 20) do |b|
+ b.report('inserting data') do
+ data.each_with_index { |e, i| vdb.put(i.to_s, e) }
+ end
+
+ b.report('reading data') do
+ data.each_with_index { |e, i| nothing = vdb.get(i.to_s) }
+ end
+end
+

0 comments on commit 986acba

Please sign in to comment.