Remarkable results with psyco and sieve of Eratosthenes

Steve Bergman steve at rueb.com
Wed Nov 29 18:59:38 EST 2006


dickinsm at gmail.com wrote:
> > BTW, can this code be made any more efficient?
>
> I'm not sure, but the following code takes around 6 seconds on my
> 1.2Ghz iBook. How does it run on your machine?
>
>

Hmm.  Come to think of it, my algorithm isn't the sieve.

Anyway, this is indeed fast as long as you have enough memory to handle
it for the range supplied.

It comes in at 1.185 seconds average on this box.

Come to think of it, there is a supposedly highly optimized version of
the sieve in The Python Cookbook that I've never bothered to actually
try out.  Hmmm...




More information about the Python-list mailing list