Sujet : Re: A very slow program
De : nospam (at) *nospam* needed.invalid (Paul)
Groupes : alt.comp.lang.c comp.lang.cDate : 03. Oct 2024, 23:25:14
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vdn23s$3sp80$1@dont-email.me>
References : 1 2
User-Agent : Ratcatcher/2.0.0.25 (Windows/20130802)
On Wed, 10/2/2024 8:44 AM, Bonita Montero wrote:
Ive developed a Sieve of Erastosthenes in C++20 with an unbeaten
performance. With this code I get all primes <= 2 ^ 32 in 140ms
on my AMD 7950X 16-core Zen4-system.
Why not measure against the programs provided in a Linux distro ?
$ time primesieve 1e6
Sieve size = 256 KiB
Threads = 1
100%
Seconds: 0.000
Primes: 78498
real 0m0.002s <=== Without printing the numbers, is pretty fast
user 0m0.000s
sys 0m0.000s
$ time primesieve 1e6 --print > NUL
real 0m0.009s <=== Without Terminal to slow I/O, is in the Unix ballpark
user 0m0.005s
sys 0m0.000s
$ time primesieve 4294967295
Sieve size = 256 KiB
Threads = 16 <=== 5700G Zen3 (8C 16T), stock speed, execution under WSL2
100%
Seconds: 0.072
Primes: 203280221
real 0m0.073s
user 0m0.869s
sys 0m0.009s
Paul