I'm trying to do some profiling using stack --enable-profiling
and I'm a bit confused about what's happening exactly.
Do I need to use also --enable-library
?.
Also, is it build in a separate directory ?What happend next I build it, will remember that am I in profiling mode or do I have to use the --enable-profiling
all the time.
It is generally recommended to profile in conjonction with the -O2
option. Does --enable-profiling
set it automatically ?
Stack support for enabling profiling works great, example:
stack build --profile --executable-profiling --library-profiling
stack exec -- example <your prog args> +RTS -p
Then see example.prof for the default output.
Update: the stack support pointed me to the right correct for exec, see https://github.com/commercialhaskell/stack/issues/1655
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With