<div dir="ltr">Hello -- I learned enough Mercury to translate a Miller-Rabin primality test and construct a process using that test to implement a prime factorization of large composite numbers (large being < 65 decimal digits). I run this in Mercury 14.01.1 under Ubuntu 64-bit running on an Apple Mac Pro using the Yosemite OS and VMWare's Fusion. When I installed Mercury into Ubuntu I used the --disable-most-grades option. <u>I am very disappointed with the slowness</u> of the procedures written for Mercury, and sometimes memory usage begins to blow up (slowly, over time as the process runs. Some of these run overnight). When I say I'm disappointed in the Mercury performance, I mean that by comparison with similar procedures I run written in Prolog, Erlang, Haskell, and Scheme, Mercury is much too slow, often taking 10 times or more as much time to complete. The Mercury runs I've made (not including those abandoned because of memory blowup) do complete and get correct results, but take way too much time to run.<div><br></div><div>Does anyone have any suggestions for speedup, other than "Avoid using Mercury for this purpose"? I'm attaching copies of the source code of the procedures that run so slowly.</div><div><br></div><div>Best regards,</div><div>Robert Buckley</div></div>