Show Menu
Cheatography

GHC and RTS Options Cheat Sheet by

http://haskell.org/haskellwiki/GHC

Profiling

profiling
-prof
show runtim­e-s­ystem statistics
+RTS -T
save runtim­e-s­ystem statistics to file
+RTS -tfile
all bindings not marked INLINE
-fprof­-auto
all top-level bindings not marked INLINE
-fprof­-au­to-top
all exported bindings nto marked INLINE
-fprof­-au­to-­exp­orted
all call sites
-fprof­-au­to-­calls

Flow of Heap Profiling

compiling with
-prof -fprof­-auto -rtsopts
running with
+RTS -h
visual­izing with
hp2ps *.hp
colored OUTPUT
hp2ps -c *.hp

- category setting

break by cost-c­enter
-hc
break by module
-hm
break by constr­uct­or/­closure
-hd
break by type
-hy

- hp2ps options

place rough bands on top
-d
big box for title
-b
EPS for latex
-e
for preview
-g
limit to n bands
-mn
use the previous parameters
-p
color output
-c
ignore marks
-y
print help
-?
 

Flow of Time Profiling

compiling with
-prof -fprof­-auto -rtsopts
running with
+RTS -p
OUTPUT
*.prof

Flow of Stack Trace

compiling with
-prof -fprof­-auto -rtsopts
running with
+RTC -xc

Flow of Code Coverage

compiling with
-fhpc
running
no options need
reporting
hpc report tix file
making html files
hpc markup tix file
Coverage data is stored in *.tix file.

- hpc options

display help
hpc help
report coverage
hpc report
make html files
hpc markup
sum multiple coverages
hpc sum
combine two coverages
hpc combine
show in verbose mode
hpc show
display version
hpc version

Optimi­zation

optimi­zation level
-On (n =1,2,3,4)
no optimi­zation
-O0
make constr­uctor fields strict
-funbo­x-s­tri­ct-­fields
static argument transf­orm­ation
-fstat­ic-­arg­ume­nt-­tra­nsf­orm­ation
for IO/ST monad
-fno-s­tat­e-hack
 

RTS options for GC

allocation area size
-Asize (default: 512KB)
suggested heap size
-Hsize (default: 0KB)
maximum heap size
-Msize (default: unlimited)

Backends

Native Code Generator
-fasm
LLVM
-fllvm
-fvia-c is obsolete.

SMP Parall­elism

use thread
-threaded
avoid repeated comput­ation of thunks
-feage­r-b­lac­kholing
avoid waiting
-fno-s­tri­ctness
use n threads
+RTS -Nn
use all processors
+RTS -N
pin threads
+RTS -qa
enable auto thread migration
+RTS -qm

- debug parall­elism

make eventlog of parallel sparks (sampled)
-lp (default)
make eventlog of parallel sparks (fully accurate)
-lf
eventlog is stored as *.eventlog
               
 

Comments

http://haskell.org/haskellwiki/GHC

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Regular Expressions Cheat Sheet
          Python Cheat Sheet