Haskell Language Stack Profiling with Stack


Example

Configure profiling for a project via stack. First build the project with the --profile flag:

stack build --profile

GHC flags are not required in the cabal file for this to work (like -prof). stack will automatically turn on profiling for both the library and executables in the project. The next time an executable runs in the project, the usual +RTS flags can be used:

stack exec -- my-bin +RTS -p