Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Importing from Haskell
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"