]>
git.saurik.com Git - redis.git/blob - client-libraries/ruby/bench.rb
2 $
:.push File
.join(File
.dirname(__FILE__
), 'lib')
7 @r = Redis
.new
#(:debug => true)
8 @r['foo'] = "The first line we sent to the server is some text"
13 @r["set#{i}"] = "The first line we sent to the server is some text"; @r["foo#{i}"]
17 x
.report("set (pipelined)") do
18 @r.pipelined
do |pipeline
|
20 pipeline
["set_pipelined#{i}"] = "The first line we sent to the server is some text"; @r["foo#{i}"]
25 x
.report("push+trim
") do
27 @r.push_head "push_trim
#{i}", i
28 @r.list_trim "push_trim
#{i}", 0, 30
32 x.report("push+
trim (pipelined
)") do
33 @r.pipelined do |pipeline|
35 pipeline.push_head "push_trim_pipelined
#{i}", i
36 pipeline.list_trim "push_trim_pipelined
#{i}", 0, 30
42 @r.keys('*').each do |k|