Using a fairly highly tuned C implementation of a Sieve of Atkin prime generator, finding the 15 millionth prime takes just over one second. Using my load and lookup Perl takes just under to do the same thing.
I think it doubtful that a pure perl implementation could achieve anywhere near this performance, as the C implementation is using hand-coded optimisations for 32-bit math--unwinding loops; using lookups instead of division; tailoring to L1 cache sizes etc. But you might prove me wrong :)
In reply to Re^6: Math help: Finding Prime Numbers
by BrowserUk
in thread Math help: Finding Prime Numbers
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |