Re: Timing Functions

2005-01-18 Thread Georg Martius
Hi Bill, please note that "null list" just forces the first cell to be evaluated. I.e. the list (x: xs), just x is evaluated, but not xs. That means, that just the code in you function is evaluated that is really required for x. If your return type is a list, then you might get away with determin

Re: Timing Functions

2005-01-17 Thread jekwtw
Many thanks to both Georg and Lemmih. Actually, I had considered laziness, but I didn't pursue it enough. I tried one version of runNReps in which I passed (f x) as an additional arg; when that didn't work, a little thought convinced me that laziness was doing me in. I also tried another approac

Re: Timing Functions

2005-01-17 Thread Georg Martius
Hi Bill, You know, Haskell is so smart that it realised that you want to measure it and therefore it performs very good -- NO, I am just kidding! Welcome to lazy programming! The thing is, that you don't force the evaluation of the result of you function f. Therefore you program doesn't bother to

Re: Timing Functions

2005-01-17 Thread Lemmih
On Mon, 17 Jan 2005 10:48:18 -0600, jekwtw <[EMAIL PROTECTED]> wrote: > > I'm putting together a script to gather run-time stats for some functions > I'm working with, and I'm having a terrible time. My strategy is to > evaluate a function a number of times and compute the difference between the