On Tue, Oct 20, 2020 at 8:41 PM Waldek Hebisch <[email protected]> wrote:
>
> On Tue, Oct 20, 2020 at 01:59:25PM +0100, Dima Pasechnik wrote:
> >
> > Why don't you use an already available fast implementation in C or C++?
> > In this case, SageMath uses NTL https://shoup.net/ntl/
> > which is very fast, and written by an expert in computational number theory.
>
> Well, in this case it would help.  However, many computations
> in FriCAS use operations on polynomials with finite field
> coefficients.  Delegating all those users of polynomials
> with finite field coefficients to external libraries is
> unrealistic (I think that is some cases FriCAS is the
> only system which can do given computation).

NTL (or Flint - which might be easier to use from FriCAS, as it's plain C
library rather than C++ - http://www.flintlib.org/features.html)
are quite feature-rich. You get multivariate polynomial arithmetic,
factorisation, gcds,
etc. (it stops at Groebner bases).

Just as ultimately for arbitrary precision arithmetic you call GMP
(via Lisp) you
can just as well call NTL or Flint for slightly higher order data.


> More attractive
> would be to delegate say polynomial multiplication to
> external library.  But this is tricky performancewise.
> FriCAS performs a lot of operations on relativly small
> polynomials.  For such polynomials cost of external
> call and (usually) data convertion is significant.
> To illustrate what I mean let me say that whan I
> implemented U32VectorPolynomialOperations I did some
> benchmarks comparing it with Sage.  For small degrees
> FriCAS was faster.  I am pretty sure that low level
> C libraries used by Sage were faster than FriCAS
> routines.

this is a tricky task to benchmark these things - as you might be at
a situation where slow generic Python implementation was used for the
thing at hand.
And also a cold start might be a problem -  libraries take a bit of
time to load.

> But Sage overhead apparently was enough
> to change which routines where faster when used from
> higher level code.  It is quite likely that calls
> from FriCAS to C would cause similar overhead.
>
> --
>                               Waldek Hebisch
>
> --
> You received this message because you are subscribed to the Google Groups 
> "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/fricas-devel/20201020194117.GB9995%40math.uni.wroc.pl.

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/CAAWYfq0hVrRYCMu-%2BJh%2BU8Th0XTWrcro6t9AVfqZwjVZOKG9NA%40mail.gmail.com.

Reply via email to