Python性能分析指南(6)

发表于:2013-11-12来源:开源中国社区作者:袁不语点击数: 标签:性能测试
05 elif n 2 : 06 return [] 07 s = range ( 3 ,n + 1 , 2 ) 08 mroot = n * * 0.5 09 half = (n + 1 ) / 2 - 1 10 i = 0 11 m = 3 12 while m = mroot: 13 if s[i]:
05     elif n<2:
06         return []
07     s=range(3,n+1,2)
08     mroot = n ** 0.5
09     half=(n+1)/2-1
10     i=0
11     m=3
12     while m <= mroot:
13         if s[i]:

原文转自:http://www.oschina.net/translate/python-performance-analysis