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
classiccms-0.5.9 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.5.8 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.5.7 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.5.6 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.5.5 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.5.2 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.5.1 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.5.0 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.4.2 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.4.1 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.4.0 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.3.9 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.3.8 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.3.7 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.3.6 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.3.5 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.3.4 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.3.3 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.3.2 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb
classiccms-0.3.1 vendor/bundle/gems/redis-2.2.2/benchmarking/speed.rb