![]() ![]() ![]() |
|
sheldon@sheldon2:~$ python3 prime.py
Find all primes up to: 200000 using 128 processes.
Time elapsed: 6.91 seconds
Number of primes found 17984
sheldon@sheldon2:~$ pypy prime.py
Find all primes up to: 200000 using 128 processes.
Time elapsed: 2.5 seconds
Number of primes found 17984
Well, the original test is too easy with pypy...
Find all primes up to: 200000 using 64 processes.
Time elapsed: 0.62 seconds
Number of primes found 17984
How about making it a little harder and finding all primes within 1 million?
Find all primes up to: 1000000 using 64 processes.
Time elapsed: 14.71 seconds
Number of primes found 78498
But this isn't the best of benchmarks.
Michael Murphy | https://murfy.nz
Referral Links: Quic Broadband (use R122101E7CV7Q for free setup)
Are you happy with what you get from Geekzone? Please consider supporting us by subscribing.
Opinions are my own and not the views of my employer.
michaelmurfy:
How about making it a little harder and finding all primes within 1 million?
Find all primes up to: 1000000 using 64 processes.
Time elapsed: 14.71 seconds
Number of primes found 78498
But this isn't the best of benchmarks.
pypy prime.py
Find all primes up to: 1000000 using 256 processes.
Time elapsed: 5.45 seconds
Number of primes found 78498
|
![]() ![]() ![]() |