Or for small numbers use more strong primetests (currently it is using exactly one):
number of fails=234 for 1 strong primetest in [1,10^6] (8 sec)
number of fails=20 for 2 strong primetests in [1,10^6] (13 sec)
number of fails=3 for 3 strong primetests in [1,10^6] (18 sec)
Another option is to use known tables for a true primetest (for "small numbers"), see:
http://primes.utm.edu/prove/prove2_3.html
There is even a faster approach for small numbers: precompute all composite numbers up to 2^32 that are strong pseudoprimes for base=2 and 3 (there are about 100 such composites), and use a perfect hash for numbers that survive these two tests (for base=2 and 3) to see if that number is on the list or not.