Skip to content

Performance and profiling

Katherine Ye edited this page Nov 3, 2019 · 5 revisions

Building, profiling, and running

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

Performance

Take a look at the Haskell performance checklist too.

To use GHC flags: stack build --profile --ghc-options="-Wall -Werror -O3"

Haskell performance resource

Haskell performance suffers with overloading

Strategy from "High-performance Haskell"

To get better Haskell reports

Try inlining functions, using seq to force evaluation, and setting cost centers. Also see the GHC guide on profiling.

Profiling the front-end

See this Chrome DevTools writeup.

Related GitHub issues

Profiling optimization

Debugging optimization

Clone this wiki locally