Why does my sieve not perform well for finding primes?
问题 I wrote two prime finder functions and the sieve only performs about 10% better. I'm using two optimizations for the simple version. Don't check even numbers Only check up to the square root or j * j <= i . ( equivalent ) and one optimization for the sieve version Only check up to the square root or i * i <= n . ( equivalent ) What optimizations can I add to the sieve? My sieve is pretty slow. I don't want to do a bitwise implementation yet, I want to understand if this implementation offers