aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-03-16 14:47:49 +0100
committerMattias Andrée <maandree@kth.se>2016-03-16 14:47:49 +0100
commitd57523fb0819b14082283d41444915486f9bd1bf (patch)
treef95c8f2138a4f932663f37a30d0b5195eeeb7087
parentOptimise zsqr, zmul, zstr, zdivmod, zpow, and zpowu (diff)
downloadlibzahl-d57523fb0819b14082283d41444915486f9bd1bf.tar.gz
libzahl-d57523fb0819b14082283d41444915486f9bd1bf.tar.bz2
libzahl-d57523fb0819b14082283d41444915486f9bd1bf.tar.xz
Add note on performance of commutative functions with assignment to operand
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--man/libzahl.715
1 files changed, 15 insertions, 0 deletions
diff --git a/man/libzahl.7 b/man/libzahl.7
index 6f7aa59..f6dc99e 100644
--- a/man/libzahl.7
+++ b/man/libzahl.7
@@ -25,6 +25,21 @@ them for reuse.
.P
With the exception of functions working with strings,
all output parameters are before the input parameters.
+.P
+Like any self-respecting big number library, libzahl
+supports assign values to variables that are also
+input variables. However, keep in mind that commutative
+functions are optimised for the first operand to also
+be the output over the second operand to also be the
+input. For example, \fIzadd(a,a,b)\fP should be faster
+than \fIzadd(a,b,a)\fP, although both are supported.
+Whether or not the function believe that it is more
+likely to occur that the input variables are different
+that the output variable than the output variable
+being the first input variable depends on the function.
+Some functions are implemented to believe that the
+first is more likely, other fucntions are implemented
+to believe that the latter is more likely.
.SH RATIONALE
GMP MP cannot be used for rubust programs. LibTomMath
is too slow, probably because of all memory allocations,