Ciao Adrien,

Il 2017-02-16 22:45 Adrien Prost-Boucle ha scritto:
Here are the results, with vanilla GMP and with floating-point mpn_sqrtrem{1,2}.

10000000 times, 128 bits ...... vanilla 1.044 s / FP 0.781 s
10000000 times, 100 bits ...... vanilla 1.373 s / FP 1.077 s

There is some noticeable speedup only for very short bit widths.
And the speedup is "only" 20-30%.

You are right, there was a too heavy overhead for small operands.

I pushed a patch that shorten the track for operands of two limbs.
( https://gmplib.org/repo/gmp/rev/bba7e03de01a )

The speed-up is noticeable.

Before the patch.
[bodrato@shell ~/gmp-repo/tests/devel]$ time ./sqrtrem_1_2 c
Values of a single limb, tested.
Values with at most a limb for reminder, tested.
Values of at most two limbs, tested.
real    6m39.725s

After the patch.
[bodrato@shell ~/gmp-repo/tests/devel]$ time ./sqrtrem_1_2 c
Values of a single limb, tested.
Values with at most a limb for reminder, tested.
Values of at most two limbs, tested.
real    3m47.247s

I'll be grateful if you run your measures again,
in particular for 100 and 128 bits.

Regards,
m

--
https://nonunadimeno.wordpress.com/
_______________________________________________
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel

Reply via email to