Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Vir Campestris Newsgroups: alt.comp.lang.c,comp.lang.c Subject: Re: OT: Re: A very slow program Date: Sat, 26 Oct 2024 21:02:10 +0100 Organization: A noiseless patient Spider Lines: 22 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 26 Oct 2024 22:02:10 +0200 (CEST) Injection-Info: dont-email.me; posting-host="1a34abd57199070a12913a6a127db11a"; logging-data="4059424"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192Z4IaO5cORJUQOEJBsEjRL18vAkBjrf8=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:MlY50Ff6QRHQJoUWlP0t+LfJvP8= Content-Language: en-GB In-Reply-To: Bytes: 2083 On 26/10/2024 15:33, Bonita Montero wrote: > Am 26.10.2024 um 16:28 schrieb Vir Campestris: > >> You're on Windows aren't you? I do know you have a far more powerful >> machine than I do. I'm running Ubuntu with Gnu compiler. (I tried >> Clang, but it's slower) > > I compared your code against mine on a AMD 7950X. > > Which operating system, and which compiler? It's probably also worth trying for a much larger number of primes. I wrote my command line parser so it will try to read the number as a double if it isn't an integer. For 100000000000 primes my code on my machine is 39s, and yours is 3:46. (I've got the mod30 version down to 28s now, but met an intractable optimiser funny) Andy