Home

Awesome

weigh Tests

Measures the memory usage of a Haskell value or function

Limitations

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:

CaseAllocatedGCs
integers count 0160
integers count 1880
integers count 107360
integers count 1007,2160

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