Permalink
Browse files

Benchmark for using the binary Jedis interface

  • Loading branch information...
1 parent c561897 commit 27a0f254e29c51e9ef61a4d5907bec185b91a92b @iconara committed Feb 2, 2012
Showing with 24 additions and 1 deletion.
  1. +21 −0 binary_jedis_bench.rb
  2. +3 −1 run.sh
View
@@ -0,0 +1,21 @@
+require 'bundler/setup'
+#require 'perftools'
+require 'java'
+require 'jedis-2.0.0.jar'
+import "redis.clients.jedis.BinaryJedis"
+require 'benchmark'
+#require "redis/connection/hiredis"
+#PerfTools::CpuProfiler.start("prof") do
+puts Benchmark.measure {
+ r = BinaryJedis.new('localhost')
+ 10.times do
+ p = r.pipelined
+ #r.pipelined do
+ 80000.times do |i|
+ p.incr_by "prefix#{i}".to_java_bytes, i
+ end
+ #end
+ p.sync
+ end
+}
+#end
View
4 run.sh
@@ -5,4 +5,6 @@ rvm 1.9.3 do ruby hiredis_bench.rb
echo "jruby redis"
rvm jruby do ruby redis_bench.rb
echo "jruby jedis"
-rvm jruby do ruby jedis_bench.rb
+rvm jruby do ruby jedis_bench.rb
+echo "jruby binary jedis"
+rvm jruby do ruby binary_jedis_bench.rb

0 comments on commit 27a0f25

Please sign in to comment.