weigh

Measure allocations of a Haskell functions/values https://github.com/fpco/weigh#readme

Version on this page:0.0.12
LTS Haskell 12.22:0.0.12
Stackage Nightly 2018-12-11:0.0.12
Latest on Hackage:0.0.12

See all snapshots weigh appears in

BSD3 licensed by Chris Done
Maintained by chrisdone@fpcomplete.com

Module documentation for 0.0.12

weigh Build Status

Measures the memory usage of a Haskell value or function

Example use

import Weigh

main :: IO ()
main =
  mainWith
    (do func "integers count 0" count 0
        func "integers count 1" count 1
        func "integers count 10" count 10
        func "integers count 100" count 100)
  where
    count :: Integer -> ()
    count 0 = ()
    count a = count (a - 1)

Output results:

Case Allocated GCs
integers count 0 16 0
integers count 1 88 0
integers count 10 736 0
integers count 100 7,216 0

Output by default is plain text table; pass --markdown to get a markdown output like the above.

Changes

0.0.12:
* Fix bug in non-unique groupings

0.0.10:
* Export Grouped

0.0.9:
* Support markdown output

0.0.8:
* Support grouping

0.0.6:
* Support GHC 8.2
* Use more reliable calculations

0.0.4:
* Added more system-independent word size calculation

0.0.3:
* Added more docs to haddocks
* Export more internal combinators

0.0.2:
* Remove magic numbers from weighing code, better accuracy
* Add additional `io` combinator

0.0.1:
* Support GHC 8.

0.0.0:
* First release.
Depends on 6 packages:
comments powered byDisqus