Created
July 29, 2014 00:08
-
-
Save LotharSee/65cca23e07fb532f9050 to your computer and use it in GitHub Desktop.
redis-py benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
results = {} | |
(1..10).each do | |
['2.4.13', '2.9.1', '2.10.1', 'master'].each do |v| | |
results[v] ||= {} | |
['10', '50','100', '500', '1000', '5000', '10000', '50000', '100000'].each do |s| | |
`git checkout #{v}` | |
results[v][s] ||= 0 | |
results[v][s] += `python main-bench.py #{s}`.to_f | |
puts v | |
end | |
end | |
end | |
puts results |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import redis | |
import time | |
import sys | |
now = time.time() | |
r = redis.Redis() | |
pipe = r.pipeline() | |
payload = "a" * int(sys.argv[1]) | |
for x in xrange(10000): | |
x += 1 | |
if x%1000 == 0: | |
pipe.execute() | |
pipe.set(x, payload) | |
pipe.execute() | |
print time.time() - now | |
r.flushdb() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment