For large, the range of primes may not fit in memory; worse, even for moderate, its cache use is highly suboptimal: the algorithm walks through the entire array, exhibiting almost no locality of reference.
For large, the range of primes may not fit in memory; worse, even for moderate, its cache use is highly suboptimal. The algorithm walks through the entire array, exhibiting almost no locality of reference.