测试代码:
import redis import time rdb = redis.StrictRedis("192.168.137.49", 6500, 0) s = time.time() lst = rdb.zrevrange("419326507", 0, -1, withscores=False) t = time.time() print(t-s) print(lst)
Python2.6.6: 0.9-1.4ms
Python3.4.2: 6.7-7.5ms
Python3.6.3: 5.8-6.5ms
Python3.6.6: 5.5-6.5ms
差异明显