
3 Dec
2007
3 Dec
'07
1:10 a.m.
Fully lazy:
data Tree = Leaf Int | Node Tree Int Tree
$ time ./A 25 49 ./A 25 18.20s user 0.04s system 99% cpu 18.257 total ^^^^^^ 3556K heap use.
Strict in the elements, lazy in the spine:
data Tree = Leaf !Int | Node Tree !Int Tree
$ time ./A 25 49 ./A 25 14.41s user 0.03s system 99% cpu 14.442 total ^^^^^^ 3056K heap use.
And, oh, element strict, with -funbox-strict-fields, $ time ./A 25 49 ./A 25 12.25s user 0.01s system 99% cpu 12.346 total -- Don