Safe Haskell | None |
---|
This module provides tools to time a sub-process (benchmark), including a facility for self-reporting execution time and reporting garbage collector overhead for GHC-compiled programs.
- measureProcess :: LineHarvester -> CommandDescr -> IO SubProcess
- selftimedHarvester :: LineHarvester
- ghcProductivityHarvester :: LineHarvester
- ghcAllocRateHarvester :: LineHarvester
- ghcMemFootprintHarvester :: LineHarvester
- taggedLineHarvester :: ByteString -> (Double -> RunResult -> RunResult) -> LineHarvester
Documentation
:: LineHarvester | Stack of harvesters |
-> CommandDescr | |
-> IO SubProcess |
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:
- An additional protocol for the process to report self-measured realtime (a line starting in SELFTIMED)
- Parsing the output of GHC's +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.
selftimedHarvester :: LineHarvesterSource
Check for a SELFTIMED line of output.
ghcProductivityHarvester :: LineHarvesterSource
Retrieve productivity (i.e. percent time NOT garbage collecting) as output from a Haskell program with +RTS -s. Productivity is a percentage (double between 0.0 and 100.0, inclusive).
taggedLineHarvester :: ByteString -> (Double -> RunResult -> RunResult) -> LineHarvesterSource