The Sieve of Eratosthenes calculates all prime numbers up to any given limit. If you're calculating primes at compile time you're simply shifting what would have been a run time speed cost to a space cost. Yes your program runs faster when ran for primes "under a certain limit" but the bigger that limit the bigger your program.
It's called the space time tradeoff. It's why algorithms aren't only rated in big O for speed but also space.
In terms of speed the Sieve is O(n log log n). Space is O(n).
Your pre-calculated Sieve has speed at O(1) and space is the same. Except the pre-calculation invents a new big O category to consider: distribution size. Where the classic Sieve algorithm's distribution size is O(1) your pre-calculated Sieve distribution size is O(n).
Congrats. It's a different way to tradeoff. One that requires maintaining and distributing n binaries. Enjoy.
time
command on that.