I am trying to profile my program. Therefore, I compile it with the -prof and -auto-all flags and run with -P to get a detailed profiling report:
$ ghc --make -prof -auto-all Test.hs $ ./Test +RTS -P
Here is a snippet of the profiling report:
COST CENTRE MODULE no. entries %time %alloc main Main 266 1 0.0 0.0 run Main 273 21845 99.3 99.7 sz Main 274 21844 0.0 0.0 size Main 268 21845 0.7 0.3
run seems to consume all the time and memory. He calls a lot of functions from different libraries, and I'm sure that most of the time is spent in one of them, but I canβt understand which one. How can I get a more detailed report? I hope that adding a lot of SCC comments manually is not the only way.
Update . At the moment, I have "solved" the problem by copying the library sources into my program directory. This allows the GHC to consider them as part of a program, and not as external libraries.
source share