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
  #2648903 7-Feb-2021 11:16
Send private message

zenourn:

 

I suspect this isn't the best of benchmarks. 

 

 

Nar its just a bit of fun mucking around.

 

Interesting to see your results guys thanks for trying it out 😀





Ding Ding Ding Ding Ding : Ice cream man , Ice cream man




SirHumphreyAppleby
2847 posts

Uber Geek


  #2648908 7-Feb-2021 11:30
Send private message

I was interested in seeing how fast this was on an APU2, but I don't have Python installed on those. Here's a Raspberry Pi 3 Model B Plus Rev 1.3 instead...

 

Find all primes up to: 200000 using 16 processes.
Time elapsed: 517.57 seconds
Number of primes found 17984


  #2648915 7-Feb-2021 11:47
Send private message

I actually wanted to try this after watching this. Was an interesting watch.

 

https://www.youtube.com/watch?v=hGyJTcdfR1E&t

 

 





Ding Ding Ding Ding Ding : Ice cream man , Ice cream man




  #2648920 7-Feb-2021 12:22
Send private message

i7 7700K (CPU running at 4.49 GHz during Prime test)

 

Loaded Python 3.9 and ran script.

 

Find all primes up to: 200000 using 32 processes.
Time elapsed: 23.83 seconds
Number of primes found 17984

 

After a reboot

 

Find all primes up to: 200000 using 32 processes.
Time elapsed: 15.74 seconds
Number of primes found 17984

 

 





Gordy

 

My first ever AM radio network connection was with a 1MHz AM crystal(OA91) radio receiver.


maslink
131 posts

Master Geek

Subscriber

  #2648978 7-Feb-2021 14:15
Send private message

MacBook Pro (2016) - i7-6700HQ @ 2.6 GHz 

 

Find all primes up to: 200000 using 32 processes.
Time elapsed: 37.9 seconds
Number of primes found 17984

 

Raspberry Pi400 @ 2GHz

 

Find all primes up to: 200000 using 16 processes.
Time elapsed: 164.48 seconds
Number of primes found 17984


Mehrts
1063 posts

Uber Geek

Trusted

  #2648982 7-Feb-2021 14:37
Send private message

Since results for a RPi 3B+ have been posted, I thought I'd dig out a RPi 4B (4GB RAM) running a fresh install of RaspPiOS & stock CPU speeds.

 

Find all primes up to: 20000 using 16 processes.
Time elapsed: 183.29 seconds
Number of primes found 17984

 

Not a bad performance boost from the previous gen RPi. These wee things are really packing a punch now.


paulgr
891 posts

Ultimate Geek


  #2649043 7-Feb-2021 18:09
Send private message

Comparing an 8700k PC with Apples new M1 Macbook Pro:

 

Both running Python 3.91

 

8700k 16gb 256gb EVO SSD:

 

Find all primes up to: 200000 using 24 processes.
Time elapsed: 11.6 seconds
Number of primes found 17984

 

M1 Macbook Pro 16gb:

 

Find all primes up to: 200000 using 32 processes
Time elapsed: 12.23 seconds
Number of primes found 17984

 

 

 

Paul (1st post)


 
 
 

Move to New Zealand's best fibre broadband service (affiliate link). Free setup code: R587125ERQ6VE. Note that to use Quic Broadband you must be comfortable with configuring your own router.
  #2649129 7-Feb-2021 19:13
Send private message

This was my 2018 Macbook pro core i7 

 

 

 

Jasons-MacBook-Pro:Documents jason$ python3 prime2.py

 

Find all primes up to: 200000 using 48 processes.

 

Time elapsed: 22.41 seconds

 

Number of primes found 17984





Ding Ding Ding Ding Ding : Ice cream man , Ice cream man


nzkc
1572 posts

Uber Geek


  #2649191 7-Feb-2021 19:58
Send private message

My Ryzen 5 1600 rig built some time ago and running a bunch of VMs:

 

Find all primes up to: 200000 using 48 processes.
Time elapsed: 12.79 seconds
Number of primes found 17984

 

Edit:

 

And a Huawei Matebook D15 with a Ryzen 3500U:

 

Find all primes up to: 200000 using 32 processes.
Time elapsed: 22.26 seconds
Number of primes found 17984

 

 

 

I expected those to be closer TBH. The first one runs Linux, the second Windows. Guess thats the difference between a desktop and mobile CPU!


sJBs
69 posts

Master Geek

ID Verified

  #2649199 7-Feb-2021 20:13
Send private message

python test.py
Find all primes up to: 200000 using 32 processes.
Time elapsed: 75.0 seconds
Number of primes found 17984

 

Python 2.7.17 (default, Sep 30 2020, 13:38:04) 
[GCC 7.5.0] on linux2

 

Intel i7-3820 from 2012.

 

 


TheoM
228 posts

Master Geek

ID Verified
Trusted

  #2649207 7-Feb-2021 20:40
Send private message

% python3 prime2.py
Find all primes up to: 200000 using 96 processes.
Time elapsed: 5.65 seconds
Number of primes found 17984

 

Ryzen 9 3900X on my OpenShift cluster

 

 

 

 





Hi! I'm TheoM, but you know that already. I run Linux mirrors in NZ together with 2degrees. Like a mirror added? PM me!

 


 

https://theom.co.nz | https://theom.nz | https://mirrorlist.mirrors.theom.nz | Providing Free Mirrors Since Ages Ago™


SirHumphreyAppleby
2847 posts

Uber Geek


  #2649210 7-Feb-2021 20:48
Send private message

I was curious to see how Python compared to C. I used TinyCC as a comparison, including the compile and execution time. The C programme ran for 2.38 seconds, versus 21.59 seconds for the Python. Adding what appears to be deliberate inefficiencies in the Python code to the C version (checking all candidate numbers, not just odd numbers, and all lower numbers as divisors), the run time for the C version is 5.15 seconds. Python is only three times slower (although the C code is single threaded). I'd consider that pretty good.

 

 

#define max_number 200000

int is_prime(int candidate_number)
{
       int divisor;
       int divisor_end;
       int found_prime;

       found_prime = 1;
       for(divisor = 2, divisor_end = candidate_number / 2; found_prime && divisor <= divisor_end; divisor++) {
               if(candidate_number % divisor == 0) found_prime = 0;
       }
       return found_prime;
}

int main()
{
       int num_primes;
       int candidate_number;

       for(num_primes = 1, candidate_number = 3; candidate_number < max_number; candidate_number += 2) {
               if(is_prime(candidate_number)) num_primes++;
       }
       printf("Number of primes found %d\n", num_primes);
       return 0;
}


ANglEAUT
2326 posts

Uber Geek

Trusted
Lifetime subscriber

  #2649257 7-Feb-2021 23:46
Send private message

sJBs: ... Time elapsed: 75.0 seconds
...
Intel i7-3820 from 2012.

 

Interesting. My 8 core i7-3770 CPU @ 3.40GHz did

 

$ python find-prime_multicore.py (fixed script)
Find all primes up to: 200000 using 32 processes.
Time elapsed: 121.91 seconds
Number of primes found 17984

$ python find-prime_singlecore.py (original script)
Find all primes up to: 200000 using 32 processes.
Time elapsed: 202.8 seconds
Number of primes found 17984

 

I wonder how much closer I could get with a clean reboot?

 

 





Please keep this GZ community vibrant by contributing in a constructive & respectful manner.


ANglEAUT
2326 posts

Uber Geek

Trusted
Lifetime subscriber

  #2649259 7-Feb-2021 23:56
Send private message

SirHumphreyAppleby:

 

Here's a Raspberry Pi 3 Model B Plus Rev 1.3 instead...
Time elapsed: 517.57 seconds

 

Mehrts:

 

I thought I'd dig out a RPi 4B (4GB RAM)
Time elapsed: 183.29 seconds

 

 

 

Raspberry Pi 4 Model B Rev 1.4 (4 core Cortex-A72 / 8GB RAM)

 

$ python3 find-prime_multicore.py 
Find all primes up to: 200000 using 16 processes.
Time elapsed: 82.66 seconds
Number of primes found 17984

$ python3 find-prime_singlecore.py 
Find all primes up to: 200000 using 16 processes.
Time elapsed: 298.08 seconds
Number of primes found 17984

 

 





Please keep this GZ community vibrant by contributing in a constructive & respectful manner.


zenourn
271 posts

Ultimate Geek

Trusted
DR

  #2649367 8-Feb-2021 11:05
Send private message

I usually run number crunching Python code these days with pypy, and it does give a reasonable improvement:

 

$python3 prime.py
Find all primes up to: 200000 using 256 processes.
Time elapsed: 3.01 seconds
Number of primes found 17984

 

$ pypy prime.py
Find all primes up to: 200000 using 256 processes.
Time elapsed: 1.21 seconds
Number of primes found 17984

 

 


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





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









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.