Skip to content

Commit caca7c0

Browse files
committed
Use new API in benchmarking/speed.rb
1 parent c4be8f4 commit caca7c0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

benchmarking/speed.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# frozen_string_literal: true
22

3-
# Run with
4-
#
5-
# $ ruby -Ilib benchmarking/speed.rb
6-
#
3+
$LOAD_PATH.push File.join(__dir__, 'lib')
74

85
require "benchmark"
96
require "redis"
@@ -15,8 +12,8 @@
1512
# n sets, n gets
1613
n.times do |i|
1714
key = "foo#{i}"
18-
r[key] = key * 10
19-
r[key]
15+
r.set(key, key * 10)
16+
r.get(key)
2017
end
2118
end
2219

0 commit comments

Comments
 (0)