Ilya Zakharevich on Mon, 08 Jan 2024 01:28:51 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

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


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