Path: csiph.com!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c++ Subject: Re: OT: A better sieve (was Re: Sieve of Erastosthenes optimized to the max) Date: Fri, 23 Feb 2024 05:51:10 -0800 Organization: A noiseless patient Spider Lines: 25 Message-ID: <86il2fwapd.fsf@linuxsc.com> References: <20240106000249.177@kylheku.com> <20240108175039.572@kylheku.com> <86frxsz94r.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: dont-email.me; posting-host="e6a7fad1a1f29d7a51dca3c2f76e6aaf"; logging-data="607287"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BA9Xdz/8KoVcxK3y85ALPIl0OKPmWkHY=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:ioDX7uAgTChJYuaerRbQ9RXOI5I= sha1:pyjO7uZjL/rJ584DTS3/fZ8S8OI= Xref: csiph.com comp.lang.c++:118331 Bonita Montero writes: > Am 16.02.2024 um 17:06 schrieb Tim Rentsch: > >> I have an implementation (written in C) based on this approach that >> determines all primes less than roughly 51.75 billion, taking just >> under 56 seconds to complete. (No threading is used - code is all >> single threaded.) > > On my 16 core PC this takes 1.73 seconds and 43 seconds > overall CPU time without printing the numbers to a file. > > C:\Users\Boni\Documents\Source\bitmapSieve>timep > "x64\Release-clang++\bitmapSieve.exe" 51750000000 "" > real 1.729s > user 43.094s > sys 0.094s > cylces 194.738.953.589 If you run the program as a single thread, what is the elapsed time? Also how long does the program take to determine all primes up to 3 trillion? Here again I am interested in the single-thread version.