hsbencher-1.0: Flexible benchmark runner for Haskell and non-Haskell benchmarks.

Safe HaskellNone

HSBencher.MeasureProcess

Description

This module provides tools to time a sub-process (benchmark), including a facility for self-reporting execution time and reporting garbage collector overhead.

Synopsis

Documentation

measureProcess :: CommandDescr -> IO SubProcessSource

This runs a sub-process and tries to determine how long it took (real time) and how much of that time was spent in the mutator vs. the garbage collector.

It is complicated by:

  1. An additional protocol for the process to report self-measured realtime (a line starting in SELFTIMED)
  2. Parsing the output of +RTS -s to retrieve productivity OR using lines of the form PRODUCTIVITY: XYZ

Note that +RTS -s is specific to Haskell/GHC, but the PRODUCTIVITY tag allows non-haskell processes to report garbage collector overhead.

This procedure is currently not threadsafe, because it changes the current working directory.