OT: Re: A very slow program

Liste des GroupesRevenir à cl c 
Sujet : OT: Re: A very slow program
De : vir.campestris (at) *nospam* invalid.invalid (Vir Campestris)
Groupes : alt.comp.lang.c comp.lang.c
Date : 03. Oct 2024, 18:06:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vdmfdl$3pknu$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 02/10/2024 13:44, 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.
It calculates first only the primes up to the square root of the
maximum. The remaining bits are partitioned according to the num-
ber of CPU-cores. Within each thread the bitmap is partitioned in
parts that fit into the L2-cache (queried via CPUID).
All operations are aligned on a cacheline-boundary to avoid false
sharing and locking of shared words.
Unbeaten?
This isn't the same program you posted before over on comp.lang.c++, but it builds and runs fine on my machine.
for 4e9 primes my machine take nearly 10 seconds for 4294967295 primes. The one I posted before over there takes 1.5 seconds.
This version is if anything slightly slower than your other one.
You might like to have a look.
(And Keith, yes, I realise there is no point whatsoever in doing this... but it's been fun. First time in years I've written anything I'm not getting paid for!)
Andy

Date Sujet#  Auteur
16 Sep 24 * A very slow program21Student Project
16 Sep 24 +- Re: A very slow program1Kaz Kylheku
16 Sep 24 +* Re: A very slow program3Paul
2 Oct 24 i`* Re: A very slow program2Vir Campestris
2 Oct 24 i `- Re: A very slow program1Paul
2 Oct 24 +* Re: A very slow program14Bonita Montero
3 Oct 24 i+* OT: Re: A very slow program12Vir Campestris
4 Oct 24 ii`* Re: OT: Re: A very slow program11Bonita Montero
20 Oct 24 ii `* Re: OT: Re: A very slow program10Vir Campestris
20 Oct 24 ii  +* Re: OT: Re: A very slow program2Kenny McCormack
26 Oct 24 ii  i`- Re: OT: Re: A very slow program1Vir Campestris
21 Oct 24 ii  +* Re: OT: Re: A very slow program6Bonita Montero
26 Oct 24 ii  i`* Re: OT: Re: A very slow program5Vir Campestris
26 Oct 24 ii  i `* Re: OT: Re: A very slow program4Bonita Montero
26 Oct 24 ii  i  `* Re: OT: Re: A very slow program3Vir Campestris
27 Oct 24 ii  i   `* Re: OT: Re: A very slow program2Bonita Montero
28 Oct 24 ii  i    `- Re: OT: Re: A very slow program1Vir Campestris
22 Oct 24 ii  `- Re: OT: Re: A very slow program1Richard Harnden
3 Oct 24 i`- Re: A very slow program1Paul
2 Oct 24 `* Re: A very slow program2Janis Papanagnou
3 Oct 24  `- Re: A very slow program1Keith Thompson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal