Sujet : Re: OT: Re: Sieve of Erastosthenes optimized to the max
De : vir.campestris (at) *nospam* invalid.invalid (Vir Campestris)
Groupes : comp.lang.c++Date : 12. Aug 2024, 16:32:33
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v9d6e1$3avh0$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
User-Agent : Mozilla Thunderbird
(replying to two messages at once)
On 10/08/2024 15:07, Tim Rentsch wrote:
I suspect the cost of extracting the divided value from the 7
bytes will be prohibitive. You may find it's best to have one
table for the N/30 parts (big entries, word aligned) and another
for the N%30 part (small entries, byte aligned). BICBW.
Two tables, absolutely. What does BICBW stand for?
But I Could Be Wrong. I thought that one was fairly well known.
On 11/08/2024 08:00, Tim Rentsch wrote:
> Note that the %30 tables can be shared. There are 8 of them, one
> for each of the eight residues mod 30 of the original prime.
I started coding that up. Then it occurred to me that there wasn't going to be much saving by storing a pointer (8 bytes on my machine) to the correct 8-byte long table. I suppose I could store a byte array index instead, but I've gone off in other directions.
You've picked up my cache management tweak.
I'll read through your code. But it might not be today. We've got the hottest day of the year here, and I don't have aircon in my garden office. In winter the computer and me are enough to keep it warm, but right now it's getting warmer by the minute.
Andy