Tutorial by Examples

The GHC compiler has mature support for compiling with profiling annotations. Using the -prof and -fprof-auto flags when compiling will add support to your binary for profiling flags for use at runtime. Suppose we have this program: main = print (fib 30) fib n = if n < 2 then 1 else fib (n-1)...
Cost centers are annotations on a Haskell program which can be added automatically by the GHC compiler -- using -fprot-auto -- or by a programmer using {-# SCC "name" #-} <expression>, where "name" is any name you wish and <expression> is any valid Haskell expression:...

Page 1 of 1