[m-users.] Too Slow
Zoltan Somogyi
zoltan.somogyi at runbox.com
Wed Apr 15 03:39:54 AEST 2015
On Tue, 14 Apr 2015 09:38:12 -0700, Delmas Buckley <rbuckley at ieee.org> wrote:
> Does anyone have any suggestions for speedup, other than "Avoid using
> Mercury for this purpose"?
You may want to consider eliminating the massive amounts of redundant
computation that your code is doing, to wit, constructing the arbitrary-precision
representations of your constants over and over and over and over and over ...
Since each call to integer/1 allocates memory, I am not surprised that you
ended up thrashing your machine.
Once you have done that, you may also want to consider using one of Mercury's
profilers to find out where your program is spending its time or allocating its
memory. That is what they are for.
Zoltan.
More information about the users
mailing list