Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


View this topic in a long page with up to 500 replies per page Create new topic
1 | 2 | 3 
sheldonlendrum
Sheldon
120 posts

Master Geek
+1 received by user: 28

Lifetime subscriber

  #2649812 8-Feb-2021 21:32
Send private message

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





Sheldon Lendrum
@SheldonLendrum
http://www.inboxdesign.co.nz/

UFF Speedtest




michaelmurfy
meow
13581 posts

Uber Geek
+1 received by user: 10914

Moderator
ID Verified
Trusted
Lifetime subscriber

  #2649865 8-Feb-2021 22:18
Send private message

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.


SumnerBoy
2079 posts

Uber Geek
+1 received by user: 306

ID Verified
Lifetime subscriber

  #2650288 9-Feb-2021 13:01
Send private message

4 core i7-4790 CPU @ 3.60GHz (8 logical processors)

 

ben@KIWI:~$ python3 primes.py
Find all primes up to: 200000 using 32 processes.
Time elapsed: 27.5 seconds
Number of primes found 17984




zenourn
281 posts

Ultimate Geek
+1 received by user: 168

ID Verified
Trusted
DR

  #2650321 9-Feb-2021 13:32
Send private message

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


1 | 2 | 3 
View this topic in a long page with up to 500 replies per page Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.