- Clone the repo
- Copy settings_sample.py to settings.py and modify it for your setup
- Make sure you have pyredis installed:
pip install pyredis
- run
./pyredis_benchmark.py
Example result:
#####################################################
# REDIS BENCHMARKING WITH PY REDIS #
#####################################################
10 keys made
repeating tests 100 times.
Get: Getting 10 keys from redis individually took 0.0286107707024 seconds.
Mget: Getting 10 keys from redis usgin mget took 0.00733426094055 seconds.
############################################################################
# DICTIONARY KEY GETTING vs. ASSIGNING KEY VALUE TO A VAR #
############################################################################
Getting dictionary key every time:
0.120291948318
Getting dictionary key and assigning it to a variable:
0.0843410491943
assigning a dictionary key value to a variable is 1.42625624731 faster
############################################################################
# HASHES COMPARISON #
############################################################################
sha256:
0.0032799430191516876
mmh3:
0.0007216100057121366
mmh3 is 4.545312555519243 faster than sha256