Originally Posted by
anon
If you are supposed to print the primes within the 20 seconds, then the competition is slightly pointless: I/O is the main bottle-neck for which micro-optimisations such as using arrays of bools (are you sure it even has a positive impact) don't help much. All in all it comes to how fast the display scrolls which might eventually make any implementation practically equal.
I think I suggested it before, but you'll get a more meaningful comparison if you change the rules, remove output requirement and time how long it takes to find N primes. You may only then be required to output them somehow (probably to file) to be able to see that the algorithm is correct in the first place.