Python 性能测试关于创建遍历查询列表List元组Tuple集合Set字典Dict有序字典OrderedDict的 速度 和 空间 测试
测试代码如下: import timeit,time from sys import getsizeof as Size from collections import OrderedDict import random List_Test = list(range(5000)) print(The Size of List is : {}.format(Size(List_Test))) Set_Test = set(range(5000)) print(The Size of Set is : {}.format(Size(Set_Test))) Tuple_Test = tupl
暂无评论