-
Notifications
You must be signed in to change notification settings - Fork 247
Importing from Haskell
Jamie Wong edited this page Oct 29, 2018
·
1 revision
GHC provides built in profiling support that can export a JSON file.
In order to do this you need to compile your executable with profiling
support and then pass the -pj
RTS flag to the executable.
This will produce a my-binary.prof
file in the current directory which
you can import into speedscope.
See the GHC manual page on profiling for more extensive information on the command line flags available.
$ ghc -prof -fprof-auto -rtsopts Main.hs
$ ./Main +RTS -pj -RTS
$ stack build --profile
$ stack exec -- my-executable +RTS -pj -RTS
stack test --profile --test-arguments "+RTS -pj -RTS"