mpn_mul is embarrassingly slow

Marco Bodrato bodrato at
Fri Apr 20 18:04:53 UTC 2018


Il Ven, 20 Aprile 2018 7:36 pm, Marc Glisse ha scritto:
> On Fri, 20 Apr 2018, Marco Bodrato wrote:
>> Il Ven, 20 Aprile 2018 12:39 pm, Marc Glisse ha scritto:
>>> there is, the timings are:
>>> mpn_mul: .56
>>> mpn_mul_n: .36
>>> mpn_mul_basecase: .16
>> Did you try also the documented function mpn_sec_mul?
> .19

> I'll admit that since I don't care about the security aspects, it didn't
> even occur to me to look at those functions for performance.

And you was right... Let's say my answer was a kind of a joke...

The meaning of it (my point of view) is:
if someone knows GMP internals, and ri needs access to mpn_mul_basecase...
ri should better use a documented function that calls it as directly as
possible; with future versions of GMP, the code might loose some
efficiency, but will very likely keep on being correct.



More information about the gmp-devel mailing list