[Haskell-cafe] Re: optimization help

apfelmus at quantentunnel.de apfelmus at quantentunnel.de
Fri Oct 13 07:52:39 EDT 2006


> The (almost) point-free versions run faster than my "fast"
> imperative version and take up significantly less heap space-- even
> the version which reads everything and then writes takes up about 1/3
> the heap space as my version.

That was not intended, though I'm very pleased :-D

>  I get the impression that point-free style is a preventive measure
> against space leaks.

Ah, good point, I didn't think about it that way. Point-less makes a bit
sure that old values are not leaking around as they are not passed
through the "pipe".

Yet, I'm a bit astonished. I thought that when compiling with -O2,
cosmetic changes should become negligible. Perhaps the strict foldl' has
an effect?

Regards,
afpelmus



More information about the Haskell-Cafe mailing list