Created
April 17, 2017 16:48
-
-
Save seiketkm/3ca7deb28e8b0579a6e443cc7f8f9f65 to your computer and use it in GitHub Desktop.
This file contains 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
import timeit | |
code = ''' | |
import redis | |
r = redis.StrictRedis() | |
r.flushdb() | |
kv = {str(j):j for j in range(10000)} | |
r.mset(kv) | |
''' | |
print(timeit.timeit(code,number=1)) |
This file contains 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
import timeit | |
code = ''' | |
import redis | |
r = redis.StrictRedis() | |
r.flushdb() | |
for i in range(100): | |
kv = {str(j):j for j in range(i*100,(i+1)*100)} | |
r.mset(kv) | |
''' | |
print(timeit.timeit(code,number=1)) |
This file contains 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
import timeit | |
code = ''' | |
import redis | |
r = redis.StrictRedis() | |
r.flushdb() | |
for i in range(10000): | |
r.set(i, i) | |
''' | |
print(timeit.timeit(code,number=1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment