Re: forprimestep 50000 times slower than needed (Actually: 100000 times!)

Ilya Zakharevich <[email protected]> Sun, 7 Jan 2024 16:28:46 -0800
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <[email protected]>
On Sun, Jan 07, 2024 at 10:51:55PM +0100, Loïc Grenié wrote:
> > Of course, with the default primelimit, the speed is yet 500 times more:
> >
> >   (08:55) gp > for(n=1,100000,forprimestep(p=nextprime(10^8),10^9,10^9,))
> >   time = 189 ms.
> >
> > (This is with 2.15.4 on Windows 7.)

>      I might be wrong, but I think you spend all your time in nextprime().

Right!  So it is not 500 times slower, but 1000 times slower!

  (16:26) gp > for(n=1,100000,forprimestep(p=10^8+7,10^9,10^9,))
  time = 78 ms.

Thanks,
Ilya