Mentions légales du service

Skip to content

consider using libprimesieve for prime iteration

Stage 1 for -pm1 and -pp1 both iterate all primes less than B1Done which can be quite slow for tests of the form

echo "200000004934000028207" | $PM1 -x0 2 1000000000-1000000010 100000000000-100000002000; checkcode $? 8 or echo 154618728587 | $PP1 -x0 3 -go 36 4294957296-4294967295 1; checkcode $? 8

I coded up replacing the handrolled getprime_r.c with libprimesieve and these tests now take 0 seconds.

Pros:

  • libprimesieve is fast and well tested
  • allows for instant primesieve_skipto
  • speeds up ./test.pp1 from 28 to 8 seconds on my machine!
  • trims off 2 minutes from make longcheck

Cons:

  • depends on external code
  • could move the few tests of this form to ./testlong.X