Python3 比 Python2 慢

测试代码:

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(lst)
print(t-s)

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
差异明显

猜你喜欢

转载自www.cnblogs.com/jhc888007/p/9319794.html