Speed up this code?

Frank Millman frank at chagford.com
Fri May 26 09:25:51 EDT 2006


bearophileHUGS at lycos.com wrote:
> If you are interested in such programs, you can take a look at this one
> too:
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/366178
>
> It requires more memory, but it's quite fast.
>
> Bye,
> bearophile

I compared the speed of this one (A) with the speed of Paul Rubin's
above (B).

Primes from 1 to 100 -
    A - 0.000118
    B - 0.000007

Primes from 1 to 200 -
    A - 0.000224
    B - 0.000008

Primes from 1 to 300 -
    A - 0.000278
    B - 0.000008

Nice one, Paul.

Frank Millman




More information about the Python-list mailing list