Sha256: 4d571cc1df81f9001dae46c37d088e062a5bcb6ba9cc30b4c37db08181a0a012

Contents?: true

Size: 289 Bytes

Versions: 5

Compression:

Stored size: 289 Bytes

Contents

require 'benchmark'
require "#{File.dirname(__FILE__)}/lib/redis"

r = Redis.new
n = (ARGV.shift || 20000).to_i

elapsed = Benchmark.realtime do
  # n sets, n gets
  n.times do |i|
    key = "foo#{i}"
    r[key] = key * 10
    r[key]
  end
end

puts '%.2f Kops' % (2 * n / 1000 / elapsed)

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
vanity-1.3.0 vendor/redis-rb/speed.rb
mikeg-vanity-1.3.0 vendor/redis-rb/speed.rb
vanity-1.2.0 vendor/redis-rb/speed.rb
vanity-1.1.1 vendor/redis-rb/speed.rb
vanity-1.1.0 vendor/redis-rb/speed.rb