[m-users.] Performance of solutions module

Charlie McGee c4cypher at gmail.com
Sat Nov 3 06:04:15 AEDT 2018


>If you can construct a list of solutions directly, that will usually be
faster
>than using solutions/2, since the latter has nontrivial overhead. Whether
>it will be *measurably* faster depends on what fraction of the program's
>overall runtime this task takes, and on whether your direct method
>for construction of solutions requires a post-pass to sort the solutions,
>or to eliminate duplicates (two tasks that solutions/2 does for you,
>and which form part of its overheads).

Building on Zoltan Somogyi's suggestion to construct your own list instead
of relying on solutions/2, if you want to get an idea of how to do that,
you can look on how the solutions library implements its calls by looking
through solutions.m
<https://github.com/Mercury-Language/mercury/blob/master/library/solutions.m>
in the library folder of the Mercury source code (The Mercury Lang github
repository is very useful for this).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20181102/eeee32cb/attachment.html>


More information about the users mailing list