[Haskell-cafe] Criterion setup/teardown functions?

tsuraan tsuraan at gmail.com
Tue Jul 17 22:52:05 CEST 2012


> See the second argument of "defaultMainWith"
> http://hackage.haskell.org/packages/archive/criterion/0.6.0.0/doc/html/Criterion-Main.html#v:defaultMainWith.

the "prep" argument is run before the entire suite is run (i.e. once
per criterion main invocation); I'm looking for some way to run code
before and after each function being benchmarked (and different code
around different functions being benchmarked).

It looks like criterion is fairly hard-wired to time everything that
is done to run a test, so I guess the answer to my question is a
straightforward "no" :)  I think I'd have to modify the Benchmarkable
typeclass to have a setup and teardown in order to do what I want.
Maybe I'll give that a shot.



More information about the Haskell-Cafe mailing list