[Haskell-cafe] ANN: benchpress 0.2.1

Johan Tibell johan.tibell at gmail.com
Tue Aug 19 04:54:25 EDT 2008


On Tue, Aug 19, 2008 at 9:37 AM, Bas van Dijk <v.dijk.bas at gmail.com> wrote:
> On Tue, Aug 19, 2008 at 8:49 AM, Johan Tibell <johan.tibell at gmail.com> wrote:
>> benchpress is a micro-benchmark library that produces statistics such
>> as min, mean, standard deviation, median, and max execution time. It
>> also computes execution time percentiles.
>
> Nice, I'm certainty going to use this. Thanks!
>
> It would be even nicer if you could also measure the elapsed CPU time
> (using System.CPUTime.getCPUTime). Than the measurement is not
> influenced by time spent in other processes and IO time.

Thanks. I will ponder how to best expose this in the interface. An
option would be to return a tuple of Stats records where the first
component is the wall clock time and the second is the CPU time. I
might have to run the action twice to avoid extra measuring overhead.
For example, in

startCpu <- getCPUTime
startWall <- getCurrentTime
action
endWall <- getCurrentTime
endCpu <- getCPUTime

the measured time includes the two calls to getCurrentTime. Running
the action twice will double the benchmark running time which might or
might not matter.

Cheers,

Johan


More information about the Haskell-Cafe mailing list