
14 Sep
2011
14 Sep
'11
7:19 a.m.
On Wednesday 14 September 2011, 09:17:16, Kazu Yamamoto wrote:
You can find the results of my friend:
https://gist.github.com/1215660
Please ignore the Japanese text. Please read the code and the results. I'm not sure why you had the different result.
Input size. The lazy foldr combinator gets compiled to a bigger, more complicated function. When the input is short, the code size makes it slower. But when the input is long, the lazy foldr wins because it can produce incremental results while the strict foldr combinator and revChop need to traverse the entire list before they can produce anything - except for the case of 'spaces', where indeed the strict foldr combinator is (slightly) faster.