Quantcast
Channel: Helloworld922's Blog
Viewing all articles
Browse latest Browse all 25

Segmented Sieve of Eratosthenes

$
0
0

From my last playing around with primes post, I've finally managed to segment the sieving algorithm. This does a few different things:

  • Reduces memory usage. Now the usage is proportional to the number of primes found plus some small fixed buffer.
  • Increases locality when sieving. This should help with performance.
  • Hopefully makes parallelization easier/possible.
  • Finding the first x primes becomes a relatively straightforward and quick task.
Read more »

Viewing all articles
Browse latest Browse all 25

Trending Articles