Skip to content

A simple yet very fast optimized version of the Segmented Sieve Algorithm based on the Sieve of Eratosthene

License

Notifications You must be signed in to change notification settings

Theoreb/Optimized-Segmented-Sieve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 

Repository files navigation

Optimized-Segmented-SIEVE

A simple yet very fast optimized version at bit-level and cache-level of the Segmented Sieves Algorithm to find and count primes numbers up to 1_000_000_000 and more in theory in a few seconds.

Description of the Project

Hello developers, this project aims to compute primes numbers in the fastest way possible !

Test

(Version 1): Without logs, the program found 455052511 primes numbers between 2 to 10_000_000_000 in 30.887541 seconds with a 596 MB cache on an Intel i7.

(Version 2): Allocated 208333334 bytes (198 MB) for the operation. Found 455052511 primes from 2 to 10_000_000_000 in 30.593504 seconds on an Intel i7.

(Lastest Version3): Calculated primes up to 10_000_000_000 in 14.576736 seconds on an Intel i7 with less than 1MB !

About

A simple yet very fast optimized version of the Segmented Sieve Algorithm based on the Sieve of Eratosthene

Topics

Resources

License

Stars

Watchers

Forks

Languages