[Haskell-cafe] Why does my module take so long to compile?

Carter Schonwald carter.schonwald at gmail.com
Mon Feb 15 17:11:02 UTC 2021


How big are your data types in the file In question? Do you ghc generics or
deriving or template Haskell? Could you share a link to the file in
question ?

On Mon, Feb 15, 2021 at 12:06 PM Troels Henriksen <athas at sigkill.dk> wrote:

> Henning Thielemann <lemming at henning-thielemann.de> writes:
>
> > On Mon, 15 Feb 2021, Troels Henriksen wrote:
> >
> >> I have a program with about 220 modules.  One of these modules takes
> >> _much_ longer to compile than the others (several minutes longer).  I
> >> don't understand why.  It compiled much faster with GHC 8.8.3, but got
> >> orders of magnitude slower when I changed to GHC 8.10.2.  I don't
> >> understand why, since I don't think there is nothing special about the
> >> module - e.g. no type-level programming.
> >
> > Does the problem persist with GHC-8.10.4?
>
> Yes.  I'll try with GHC 9.10.1 once my dependencies catch up.
>
> > I would try to out-comment parts of the module and watch when
> > compilation becomes faster.
>
> I will try that.  I also noticed that other modules are affected as
> well, although to a lesser degree, and by passing
> '--ghc-options=-dshow-passes' I obtained this information:
>
> !!! Desugar [Futhark.Pass.ExtractKernels.DistributeNests]: finished in
> 255448.24 milliseconds, allocated 363811.623 megabytes
>
> So apparently the "desugar" pass takes over four minutes.  Apart from
> lowering Haskell into Core, what exactly does this pass do that is so
> expensive?  The following Simplifier passes take almost no time in
> comparison.
>
> --
> \  Troels
> /\ Henriksen
> _______________________________________________
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20210215/ec9ca4fb/attachment.html>


More information about the Haskell-Cafe mailing list