[Haskell-cafe] Performance counters

Andrew Coppin andrewcoppin at btinternet.com
Tue May 5 17:06:26 EDT 2009

Magnus Therning wrote:
> Andrew Coppin wrote:
>> Stuff like "how many times does this function get called? How what's 
>> the maximum depth it recurses to?" That kind of thing.
> It won't help you, but wouldn't it be the kind of thing that'd fit in 
> the GHC runtime?
> Do you also require that the counters are available to the program 
> itself?
> (This is starting to sound like something Don mentioned in his talk in 
> London...)

[I'm getting *really* tired of my ISP thinking that 30% of the traffic 
from Haskell-cafe is spam. If only there was a way to whitelist it or 
something... repeatedly clicking "this is not spam" doesn't seem to get 
the message across.]

Um... hmm, that's a good question. Basically I've written a program that 
does adaptive sampling, and I want to see how much it's recursing. There 
are two parameters you can adjust: the minimum step size, and the 
maximum error tollerance. I'd like to know which of the two limits the 
program is reaching. (In other words, does the error eventually fall 
below the threshold, or does the step size become too small first?)

I guess *ideally* I'd like the end user to be able to find this out from 
the running program... but I guess to do that there really is no other 
way than to sprinkle monads or unsafe I/O around the place.

More information about the Haskell-Cafe mailing list