Profiling analyzing ghc compilation

Hi, Is there a way to profile (time/space) GHC compilation itself, I'd be interested in what compilation steps in compiling my project take long and how much RAM it uses/why it uses so much RAM, so I can identify what to rewrite, remove, and split to get a leaner build. Thanks, Martin PS.: I hope this is the right place to ask this.

Hi Martin, Having seen this before, I knew there had to be a compiler option for this... and checking the Debugging the Compiler section of the manual surfaces -dshow-passes, which should do exactly what you're asking for. I hope this helps! Richard
On Feb 18, 2021, at 10:53 AM, Martin Heuschober
wrote: Hi,
Is there a way to profile (time/space) GHC compilation itself, I'd be interested in what compilation steps in compiling my project take long and how much RAM it uses/why it uses so much RAM, so I can identify what to rewrite, remove, and split to get a leaner build.
Thanks, Martin
PS.: I hope this is the right place to ask this.
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

There is also `|-ddump-timings| https://downloads.haskell.org/~ghc/9.0.1/docs/html/users_guide/debugging.htm...` (see https://downloads.haskell.org/~ghc/9.0.1/docs/html/users_guide/flags.html#co...), which seems to print a subset of what `-dshow-passes` prints? If I ever have time, I'd love to make something like Clang's `time-trace` functionality, i.e., printing per-file pass timings in Chrome tracing profiling format, so that one can get pretty flame graphs. (https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-profiler...) The data already seems to be there. Maybe someone else gets to it before me =) Cheers, Ben
participants (3)
-
Benjamin Maurer
-
Martin Heuschober
-
Richard Eisenberg