Why is GHC so much worse than JHC when computing the Ackermann function?

Mikhail Glushenkov the.dead.shall.rise at gmail.com
Sat Apr 20 14:53:08 CEST 2013


Hi,

On 20 April 2013 14:20, Dan Doel <dan.doel at gmail.com> wrote:
> There's something strange going on in this example. For instance, setting
> (-M) heap limits as low as 40K seems to have no effect, even though the
> program easily uses more than 8G.

Apparently the only things it allocates is stack chunks.

I managed to produce a version of this program that runs approximately
as fast as the Ocaml one by manually unrolling the main loop [1], but
it still has to be run with +RTS -kc1M to avoid the memory leak.

[1] https://gist.github.com/23Skidoo/5425891

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments



More information about the Glasgow-haskell-users mailing list