Python性能分析指南(14)

发表于:2013-11-12来源:开源中国社区作者:袁不语点击数: 标签:性能测试
06 3 7.9219 MB 0.0000 MB def primes(n): 07 4 7.9219 MB 0.0000 MB if n = = 2 : 08 5 return [ 2 ] 09 6 7.9219 MB 0.0000 MB elif n 2 : 10 7 return [] 11 8 7.9219 MB 0.0000 MB s = range ( 3 ,n + 1 , 2 )
06      3    7.9219 MB  0.0000 MB   def primes(n): 
07      4    7.9219 MB  0.0000 MB       if n==2:
08      5                                   return [2]
09      6    7.9219 MB  0.0000 MB       elif n<2:
10      7                                   return []
11      8    7.9219 MB  0.0000 MB       s=range(3,n+1,2)

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