Performance and profiling
To build the system: stack build --profile
To run it: stack exec -- <path-to-penrose-binary> +RTS -p -RTS <command-line flags>
e.g. stack exec -- /Users/$USERNAME/.local/bin/penrose +RTS -p -RTS linear-algebra-domain/vectorsAddition-3.sub linear-algebra-domain/linear-algebra.sty linear-algebra-domain/linear-algebra.dsl
To view the profile: examples/
will contain a file called penrose.prof
Take a look at the Haskell performance checklist too.
To use GHC flags: stack build --profile --ghc-options="-Wall -Werror -O3"
Haskell performance suffers with overloading
Strategy from "High-performance Haskell"
Try inlining functions, using seq
to force evaluation, and setting cost centers. Also see the GHC guide on profiling.
See this Chrome DevTools writeup.
Found a problem or got a suggestion? Please open a GitHub issue and tag it with documentation
!