2013年3月25日
摘要: 在Twitter上看到日本友人@IanMLewis的一条推,测试了下python中Set和List的性能差距,真是不测不知道一测吓一跳,差距能有数百倍 –!他的原文地址在这里:Pythonのセットがすごい。翻译成中文如下:本来是知道在Python中使用Set是比较高效,但是没想到竟然有这么大的差距:~$ python -m timeit -n 1000 "[x for x in range(1000) if x in range(500, 1500)]"1000 loops, best of 3: 28.2 msec per loop~$ python -m timeit 阅读全文
posted @ 2013-03-25 20:46 呆头龙 阅读(431) 评论(0) 推荐(0) 编辑

点击这里给我发消息