> Never trust the program you're running to give you accurate time. Use
> 'time python foo.py' instead.
Given that we're comparing different environments, that's only a good
idea if you also run zero-loop tests so you can subtract the startup
and shutdown costs.
Regards,
Garth.
_
On 4/26/05, Michael Spencer <[EMAIL PROTECTED]> wrote:
> IronPython runs this sieve function 20-30% faster than CPython
>
> def primes2(n):
> if n<2: return []
> s=range(1,n,2) # [1,3,5n | n-1]
> s[0] = 2
> len_s = len(s)
> for i in xrange(1,int(sqrt(n)/2)+1):
>
IronPython runs this sieve function 20-30% faster than CPython
def primes2(n):
if n<2: return []
s=range(1,n,2) # [1,3,5n | n-1]
s[0] = 2
len_s = len(s)
for i in xrange(1,int(sqrt(n)/2)+1):
m = s[i]
if m:
j=(m*m)/2
while j
return [