Re[2]: sum, perfomance?

John van Groningen johnvg@cs.kun.nl
Tue, 6 Jun 2000 13:05:11 +0200


Valery wrote:
>what compiler version do you mean here?

The sum function in StdList was first implemented for Clean 1.0, which could not optimise foldl and foldr functions.
I don't know any more the first version of the compiler that can perform this optimisation, but if the foldr function in the StdEnv of this compiler is defined using a macro, it can.
At first the compiler could only optimise foldl calls with all arguments, but the most recent compilers can also optimise calls with fewer arguments, for example foldl (+) 0.
 
Regards,

John