Odd Performance

Tom Pledger Tom.Pledger@peace.com
Wed, 23 Oct 2002 10:39:12 +1300


Tom Pledger writes:
 | Tim Otten writes:
 |  :
 |  | Can anyone suggest why the tighter algorithm exhibits significantly
 |  | worse performance? Is takeWhile significicantly more expensive than
 |  | take?
 | 
 | No.

Correction (before anyone else pounces on it):

Only if the predicate function (the p in takeWhile p xs) is
significantly more expensive than a constant-cost piece of arithmetic
and pattern-matching.