Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmarks for > 2 limbs + question on licensing #266

Open
timotheecour opened this issue Jan 15, 2021 · 1 comment
Open

benchmarks for > 2 limbs + question on licensing #266

timotheecour opened this issue Jan 15, 2021 · 1 comment

Comments

@timotheecour
Copy link

timotheecour commented Jan 15, 2021

as mentioned in nim-lang/Nim#14696 (comment), fort the benchmarks in https://bluescarni.github.io/mppp/integer_benchmarks.html:

those benchmarks are a bit cherry-picking; as it only shows 1 and 2-limb sizes.

are there benchmarks for > 2 limbs?
Until then, what kind of performance to expect compared to gmp for > 2 limbs?

Unrelated question: the readme says:

Built on top of the GNU multiprecision stack (GMP, MPFR, MPC), mp++ was initially conceived as a GMP wrapper

Given this fact, can you please clarify whether using mpp is subject to the licensing terms of gmp?

Since version 6, GMP is distributed under the dual licenses, GNU LGPL v3 and GNU GPL v2. These licenses make the library free to use, share, and improve, and allow you to pass on the result. The GNU licenses give freedoms, but also set firm restrictions on the use with non-free programs.

@bluescarni
Copy link
Owner

@timotheecour

are there benchmarks for > 2 limbs?
Until then, what kind of performance to expect compared to gmp for > 2 limbs?

No, there are no benchmarks for > 2 limbs.

In principle, for low limb counts mp++ could be faster than plain GMP (as long as you stay in stack-allocated storage), but in practice I have not profiled or optimised for this use case (yet?). Currently the main use case of the integer class is to be fast for 1-2 limbs, ideally approaching the performance of hardware integers. For higher limb counts, the assumption is that the vanilla GMP routines (as opposed to the optimised 1-2 limbs codepaths of mp++) are fast enough.

If there is enough demand, I am open to the idea of investing time in optimising performance for higher limb counts. It's just not something that people have asked for yet :)

Given this fact, can you please clarify whether using mpp is subject to the licensing terms of gmp?

The mp++ code itself is licensed under the MPL-2.0 license, but of course mp++ has a dependency on GMP. I am not a lawyer, but given that GMP is used in commercial computer algebra systems (Mathematica, Maple, ...) I am assuming there are no licensing conflicts with MPL-2.0 (of course as long as you are picking the LGPL in GMP's dual-iicense scheme).

@timotheecour timotheecour changed the title benchmarks for > 2 limbs? benchmarks for > 2 limbs + question on licensing Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants