Getting a breakdown of time spend in compile phases

Dear Cafe, I have a Haskell Project where I have a module that quite heavily makes use of constraints and takes ages to compile per module. It also uses some type checker plugins but I'm unsure if they are causing the slowness. So what I would like to see is a breakdown of how much time GHC is spending on compilation of a module. Does something like this exist? Best regards, Rowan Goemans

There is `-ddump-timings`.
On Sat, Sep 3, 2022 at 10:31 AM rowan goemans
Dear Cafe,
I have a Haskell Project where I have a module that quite heavily makes use of constraints and takes ages to compile per module. It also uses some type checker plugins but I'm unsure if they are causing the slowness. So what I would like to see is a breakdown of how much time GHC is spending on compilation of a module. Does something like this exist?
Best regards,
Rowan Goemans
_______________________________________________ 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.
-- brandon s allbery kf8nh allbery.b@gmail.com

Great, exactly what I was looking for, thanks! For some reason I wasn't able to find this. On 9/3/22 16:34, Brandon Allbery wrote:
There is `-ddump-timings`.
On Sat, Sep 3, 2022 at 10:31 AM rowan goemans
wrote: Dear Cafe,
I have a Haskell Project where I have a module that quite heavily makes use of constraints and takes ages to compile per module. It also uses some type checker plugins but I'm unsure if they are causing the slowness. So what I would like to see is a breakdown of how much time GHC is spending on compilation of a module. Does something like this exist?
Best regards,
Rowan Goemans
_______________________________________________ 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.

Hi Rowan,
I had a nice experience using
https://github.com/codedownio/time-ghc-modules. Do tell us if this fits
your needs. :)
Cheers,
Hécate
Le 3 septembre 2022 16:31:35 rowan goemans
Dear Cafe,
I have a Haskell Project where I have a module that quite heavily makes use of constraints and takes ages to compile per module. It also uses some type checker plugins but I'm unsure if they are causing the slowness. So what I would like to see is a breakdown of how much time GHC is spending on compilation of a module. Does something like this exist?
Best regards,
Rowan Goemans
_______________________________________________ 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.

Hi Hécate, Thank you this helps a lot. I now at least have confirmed my suspicion that it's the type checker. It spends a whopping 50 seconds in there for a module not even 300 lines of code. Is there someway to analyze the type checker specifically? I know there is tc-trace but that doesn't really tell me what is taking long. Best regards, Rowan Goemans On 9/3/22 20:21, Hécate wrote:
Hi Rowan,
I had a nice experience using https://github.com/codedownio/time-ghc-modules. Do tell us if this fits your needs. :)
Cheers, Hécate
Le 3 septembre 2022 16:31:35 rowan goemans
a écrit : Dear Cafe,
I have a Haskell Project where I have a module that quite heavily makes use of constraints and takes ages to compile per module. It also uses some type checker plugins but I'm unsure if they are causing the slowness. So what I would like to see is a breakdown of how much time GHC is spending on compilation of a module. Does something like this exist?
Best regards,
Rowan Goemans
_______________________________________________ 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.

You may find more help with debugging GHC on the ghc-devs mailing list: https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs Am Sa., 3. Sept. 2022 um 22:57 Uhr schrieb rowan goemans < goemansrowan@gmail.com>:
Hi Hécate,
Thank you this helps a lot. I now at least have confirmed my suspicion that it's the type checker. It spends a whopping 50 seconds in there for a module not even 300 lines of code. Is there someway to analyze the type checker specifically? I know there is tc-trace but that doesn't really tell me what is taking long.
Best regards,
Rowan Goemans On 9/3/22 20:21, Hécate wrote:
Hi Rowan,
I had a nice experience using https://github.com/codedownio/time-ghc-modules. Do tell us if this fits your needs. :)
Cheers, Hécate
Le 3 septembre 2022 16:31:35 rowan goemans
a écrit : Dear Cafe,
I have a Haskell Project where I have a module that quite heavily makes use of constraints and takes ages to compile per module. It also uses some type checker plugins but I'm unsure if they are causing the slowness. So what I would like to see is a breakdown of how much time GHC is spending on compilation of a module. Does something like this exist?
Best regards,
Rowan Goemans
_______________________________________________ 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.
_______________________________________________ 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.

You may want to take a look at this talk
https://www.youtube.com/watch?v=ABScdJqy5wg by Edsko. It talks about
several cases where the compile time may blow up quadratically
depending on the size of the structure. Your problem might be
something similar. Also see
https://hackage.haskell.org/package/large-records .
-harendra
On Sun, 4 Sept 2022 at 02:26, rowan goemans
Hi Hécate,
Thank you this helps a lot. I now at least have confirmed my suspicion that it's the type checker. It spends a whopping 50 seconds in there for a module not even 300 lines of code. Is there someway to analyze the type checker specifically? I know there is tc-trace but that doesn't really tell me what is taking long.
Best regards,
Rowan Goemans
On 9/3/22 20:21, Hécate wrote:
Hi Rowan,
I had a nice experience using https://github.com/codedownio/time-ghc-modules. Do tell us if this fits your needs. :)
Cheers, Hécate
Le 3 septembre 2022 16:31:35 rowan goemans
a écrit : Dear Cafe,
I have a Haskell Project where I have a module that quite heavily makes use of constraints and takes ages to compile per module. It also uses some type checker plugins but I'm unsure if they are causing the slowness. So what I would like to see is a breakdown of how much time GHC is spending on compilation of a module. Does something like this exist?
Best regards,
Rowan Goemans
_______________________________________________ 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.
_______________________________________________ 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.
participants (5)
-
Brandon Allbery
-
Harendra Kumar
-
Hécate
-
rowan goemans
-
Simon Jakobi