3 ms·
Here is my results on a desktop PC from 2010 (i3 CPU 540 @ 3.07GHz × 4): g++ -O3 -o prime PrimeChecker.c time ./prime 9592 primes between 0 and 10
by vmorgulis 11y ago
Here is my results on a desktop PC from 2010 (i3 CPU 540 @ 3.07GHz × 4):
g++ -O3 -o prime PrimeChecker.c
time ./prime
9592 primes between 0 and 100000
Time taken = 18.0476
real 0m18.073s
user 0m18.048s
sys 0m0.000s
It seems the Moore's Law is no longer valid...
- gambiting 11y agoWell I've tried an even older machine - a 2009 MacBook Pro with a 2.4GHz Core2Duo. g++ PrimeChecker.c -o PrimeChecker: Time taken = 26.2687 g++ PrimeChecker.c -O2 -o PrimeChecker: Time taken = 21.6129 So I would say that this his test doesn't really prove anything, not with an operation as simple as finding primes.
- B1FF_PSUVM 11y agoWell, that kind of numbers is why I'm tossing 200 bucks worth of RAM and SSD at my 2009 machine, instead of getting the new shiny. (Although the new shiny is indeed pretty - I'll confess to almost drooling at http://www.macrumors.com/roundup/retina-macbook-air/ http://www.macrumors.com/roundup/retina-macbook-air/ ;-)