Performance improvements to sieve