mpz_prevprime

Seth Troisi braintwo at gmail.com
Thu Jan 30 20:12:23 UTC 2020


I had measured the time as 3 seconds and left a comment in the patch.
Thanks Torbjörn for the rule of thumb of 1s,
I've disabled both gap test but left the code is so that I can uncomment
and run it when doing serious changes to the file.
Attached is new patch (and it can also be seen here:
https://github.com/sethtroisi/libgmp/pull/12/files)

I was referencing my change for mpz_prevprime which is implemented via a
macro shared with mpz_nextprime
It was attached to my previous message in this chain (
https://gmplib.org/list-archives/gmp-devel/2019-September/005479.html)




On Thu, Jan 30, 2020 at 4:45 AM Marco Bodrato <bodrato at mail.dm.unipi.it>
wrote:

> Ciao,
>
> Il 2020-01-28 23:31 Seth Troisi ha scritto:
> > There doesn't seem to be any objection to this change and it has good
> > tests.
> >
> > I think the macro can be improved (and potentially expanded to
> > mpz_nextprime_stride) but I hope that can happen after an initial
> > version is checked in.
>
> I'm sorry, but I'm not sure I understand which change and which macro
> are you writing about.
>
> > pulling the patch for t-nextprime.c proposed in
> > https://gmplib.org/list-archives/gmp-devel/2020-January/005672.html
> > should probably be done first to simplify the testing here, I'm happy
>
> In that message you proposed a patch to t-nextprime.c
>
> On an ARM processor I'm playing with, before that patch:
>   $ time tests/mpz/t-nextprime
>   real  0m0.254s
> after the patch:
>   $ time tests/mpz/t-nextprime
>   real  0m25.878s
>
> So, the time used by the test is increased by a factor 100...
>
> Keep in mind that each test is run hundreds of times every day, look at:
> https://gmplib.org/devel/tm/gmp/date.html
> Moreover the tests are suggested to every user to check if the code they
> compiled with their tools id working as expected.
>
> Can you explain which feature or part of code is tested with the patched
> test and was not tested before? After that, it will be possible to
> evaluate if it is worth patching.
>
> Ĝis,
> m
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 12.diff
Type: text/x-patch
Size: 3735 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-devel/attachments/20200130/2d6079f8/attachment-0001.bin>


More information about the gmp-devel mailing list