Doug Telford wrote:
> I programmed the pollard rho factorization program in Fricas (with gmp) and
> the execution time was very good (about 20 % longer that using C with gmp,
> which has the fastest time). The test was finding a factor of 2^257-1 and
> it took about 14 seconds (I am using an Intel 6600K cpu @ 4.4 GHz).
> Observations on programming pollard rho in Adlor/FriCAS (Fricas with gmp):
>
> 1. There are a lot more semicolons and braces ( { } ) for if-then else.
> 2. I could not use the macro mod ==> positiveRemainder
> 3. The program runs 50% longer than the FriCAS version. It may be because
> gmp is not used. I believe using gmp is non trivial with Aldor/FriCAS but
> is automatic under Fricas (if gmp is installed).
Concerning performance: all code running inside FriCAS benefits from
gmp without additional effort. OTOH 514 bit integers (largest that
should appear in your computation) are still relatively small and
are multiplied without GMP (GMP would get used for two factors,
each above 1279 bits). In may experience differences like this
are mostly due to compiler optimization. In particular look
at inlining possibilities. FriCAS can expand inline simple
functions and this makes big difference to performance.
Aldor is _much_ better at inlining and has several other
optimizations. However, AFAIK there is no inlining between
FriCAS and Aldor domains. So FriCAS code using simple FriCAS
function will benefit from inlining. Aldor code using the
same FriCAS function will perform normal call. So if you
care about performance make sure that performance critical
pieces are purely Aldor or purely FriCAS -- going trough
interface blocks optimizations.
Note: at larger granularity cost of function calls does not
matter. But in tight loop it can dominate everyting else.
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.