Re: OT: Re: Sieve of Erastosthenes optimized to the max

Liste des GroupesRevenir à cl c++ 
Sujet : Re: OT: Re: Sieve of Erastosthenes optimized to the max
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.c++
Date : 26. Aug 2024, 17:35:55
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <864j775jis.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Vir Campestris <vir.campestris@invalid.invalid> writes:

On 20/08/2024 05:08, red floyd wrote:
>
So I'm a little late, but here's my effort to use the modulo
30 trick.
>
Using g++ 12.4.0, Cygwin under Windows 11 22631, Ryzen 5
5600x, 64GB RAM
>
g++ -O3 -std=c++17
5761455 primess less than 100 million in 0.182269s
50847534 primes less than 1 billion in 2.841167s
455052511 primes less than 10billion in 53.009133s
>
It's slow.
>
Looking quickly at the (remarkably small) code I see line 30:
>
return std::make_tuple(val / MOD_VALUE, masks[val % MOD_VALUE]);
>
That mod and div are being called for every single time you
mark a prime in the bitmap.

That is a cost but I'm pretty sure it's not the most important
aspect.

Date Sujet#  Auteur
30 Jun 24 * Re: Sieve of Erastosthenes optimized to the max54Vir Campestris
2 Jul 24 `* Re: Sieve of Erastosthenes optimized to the max53Tim Rentsch
2 Jul 24  +- Re: Sieve of Erastosthenes optimized to the max1Vir Campestris
3 Jul 24  `* Re: Sieve of Erastosthenes optimized to the max51Vir Campestris
15 Jul 24   +- Re: Sieve of Erastosthenes optimized to the max1Tim Rentsch
20 Jul 24   +* Re: Sieve of Erastosthenes optimized to the max48Tim Rentsch
25 Jul 24   i`* OT: Re: Sieve of Erastosthenes optimized to the max47Vir Campestris
10 Aug 24   i +* Re: OT: Re: Sieve of Erastosthenes optimized to the max44Tim Rentsch
12 Aug 24   i i+* Re: OT: Re: Sieve of Erastosthenes optimized to the max2Vir Campestris
16 Aug 24   i ii`- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Tim Rentsch
15 Aug 24   i i`* Re: OT: Re: Sieve of Erastosthenes optimized to the max41Vir Campestris
16 Aug 24   i i `* Re: OT: Re: Sieve of Erastosthenes optimized to the max40Tim Rentsch
16 Aug 24   i i  +* Re: OT: Re: Sieve of Erastosthenes optimized to the max38Bonita Montero
16 Aug 24   i i  i+- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Bonita Montero
19 Aug 24   i i  i+* Re: OT: Re: Sieve of Erastosthenes optimized to the max19Vir Campestris
20 Aug 24   i i  ii`* Re: OT: Re: Sieve of Erastosthenes optimized to the max18Bonita Montero
20 Aug 24   i i  ii `* Re: OT: Re: Sieve of Erastosthenes optimized to the max17Bonita Montero
20 Aug 24   i i  ii  +- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Bonita Montero
20 Aug 24   i i  ii  `* Re: OT: Re: Sieve of Erastosthenes optimized to the max15Vir Campestris
20 Aug 24   i i  ii   +- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Bonita Montero
26 Aug 24   i i  ii   `* Re: OT: Re: Sieve of Erastosthenes optimized to the max13Tim Rentsch
27 Aug 24   i i  ii    `* Re: OT: Re: Sieve of Erastosthenes optimized to the max12Bonita Montero
1 Sep 24   i i  ii     `* Re: OT: Re: Sieve of Erastosthenes optimized to the max11Vir Campestris
2 Sep 24   i i  ii      `* Re: OT: Re: Sieve of Erastosthenes optimized to the max10Tim Rentsch
2 Sep 24   i i  ii       +- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Bonita Montero
3 Sep 24   i i  ii       `* Re: OT: Re: Sieve of Erastosthenes optimized to the max8Vir Campestris
28 Sep 24   i i  ii        `* Re: OT: Re: Sieve of Erastosthenes optimized to the max7Tim Rentsch
28 Sep 24   i i  ii         `* Re: OT: Re: Sieve of Erastosthenes optimized to the max6Keith Thompson
2 Oct 24   i i  ii          `* Re: OT: Re: Sieve of Erastosthenes optimized to the max5Vir Campestris
2 Oct 24   i i  ii           +- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Bonita Montero
7 Oct 24   i i  ii           `* Re: OT: Re: Sieve of Erastosthenes optimized to the max3Tim Rentsch
20 Oct 24   i i  ii            `* Re: OT: Re: Sieve of Erastosthenes optimized to the max2Vir Campestris
4 Nov 24   i i  ii             `- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Tim Rentsch
19 Aug 24   i i  i+* Re: OT: Re: Sieve of Erastosthenes optimized to the max12Vir Campestris
20 Aug 24   i i  ii+* Re: OT: Re: Sieve of Erastosthenes optimized to the max4red floyd
20 Aug 24   i i  iii+* Re: OT: Re: Sieve of Erastosthenes optimized to the max2Vir Campestris
26 Aug 24   i i  iiii`- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Tim Rentsch
26 Aug 24   i i  iii`- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Tim Rentsch
20 Aug 24   i i  ii+* Re: OT: Re: Sieve of Erastosthenes optimized to the max3Bonita Montero
20 Aug 24   i i  iii+- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Bonita Montero
20 Aug 24   i i  iii`- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Bonita Montero
20 Aug 24   i i  ii`* Re: OT: Re: Sieve of Erastosthenes optimized to the max4Bonita Montero
22 Aug 24   i i  ii `* Re: OT: Re: Sieve of Erastosthenes optimized to the max3Vir Campestris
22 Aug 24   i i  ii  `* Re: OT: Re: Sieve of Erastosthenes optimized to the max2Bonita Montero
22 Aug 24   i i  ii   `- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Vir Campestris
22 Aug 24   i i  i`* Re: OT: Re: Sieve of Erastosthenes optimized to the max5Vir Campestris
23 Aug 24   i i  i +* Re: OT: Re: Sieve of Erastosthenes optimized to the max3red floyd
26 Aug 24   i i  i i+- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Tim Rentsch
28 Sep 24   i i  i i`- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Andrey Tarasevich
26 Aug 24   i i  i `- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Tim Rentsch
19 Aug 24   i i  `- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Tim Rentsch
11 Aug 24   i +- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Tim Rentsch
11 Aug 24   i `- Re: OT: Re: Sieve of Erastosthenes optimized to the max1Tim Rentsch
23 Jul 24   `- Re: Sieve of Erastosthenes optimized to the max1Tim Rentsch

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal