Profiling builds with Stack

后端 未结 4 1428
囚心锁ツ
囚心锁ツ 2020-12-22 19:51

How do I tell stack to build my executable and all its dependencies with -prof?

Simply adding it to ghc-options in the

4条回答
  •  我在风中等你
    2020-12-22 20:33

    For stack build, stack bench and stack test you can just use stack build/bench/test --profile. You may have to stack clean first to get it to recompile with profiling.

    For stack build you will still have to pass +RTS -p or whatever option you need (see GHC User Guide) when running the executable as in @Tomáš Janoušek answer.

    You can also find more information in the debugging section of the stack user guide.

提交回复
热议问题