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

David Feuer david.feuer at gmail.com
Mon Feb 15 17:13:21 UTC 2021


I suspect that to get deeper into this you'll need a debugging build of
GHC, which I believe will break down the desugaring pass into its
constituent sub-passes. One possibility is that the "gentle optimization"
pass is proving not to be so gentle on your code.

On Mon, Feb 15, 2021, 12:03 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/b57cd25d/attachment.html>


More information about the Haskell-Cafe mailing list