Skip to content
forked from fpco/weigh

Measure allocations of a Haskell functions/values

License

Notifications You must be signed in to change notification settings

locallycompact/weigh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

weigh Build Status

Measures the memory usage of a Haskell value or function

Limitations

  • ⚠️ Turn off the -threaded flag, otherwise it will cause inconsistent results.

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.

About

Measure allocations of a Haskell functions/values

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 100.0%