Sha256: f407333422f8621da60b64c56f72d7ec1fbf7233f1b9312cbc0425712a0ff001

Contents?: true

Size: 314 Bytes

Versions: 103

Compression:

Stored size: 314 Bytes

Contents

# Run with
#
#   $ ruby -Ilib benchmarking/speed.rb
#

require "benchmark"
require "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

103 entries across 101 versions & 16 rubygems

Version Path
finsync_redis-3.3.5 benchmarking/speed.rb
redis-4.0.3 benchmarking/speed.rb
redis-4.1.0.beta1 benchmarking/speed.rb
redis-4.0.2 benchmarking/speed.rb
redis-3.3.5 benchmarking/speed.rb
redis-4.0.1 benchmarking/speed.rb
redis-4.0.0 benchmarking/speed.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/redis-3.3.3/benchmarking/speed.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/benchmarking/speed.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/benchmarking/speed.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/benchmarking/speed.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/redis-3.3.3/benchmarking/speed.rb
redis-3.3.3 benchmarking/speed.rb
abaci-0.3.0 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.1/benchmarking/speed.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.2/benchmarking/speed.rb
redis-4.0.0.rc1 benchmarking/speed.rb
redis-3.3.2 benchmarking/speed.rb
redis-3.3.1 benchmarking/speed.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/redis-3.3.0/benchmarking/speed.rb