Opened 2 years ago

Last modified 2 years ago

#13744 new bug

Compile-time regression in 8.2 when compiling bloodhound's test suite

Reported by: refold Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.2.1-rc2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

GHC 8.2 takes much longer to compile bloodhound's test suite than GHC 8.0.2. With 8.0.2, compilation takes approximately a minute on my machine, 8.2 takes approximately four minutes and uses much more memory.

How to reproduce:

$ git clone -b ghc-8.2 https://github.com/23Skidoo/bloodhound.git
$ cd bloodhound
$ cabal new-build -w ghc-8.0.1 --enable-tests
$ cabal new-build -w ghc-8.2.1 --enable-tests 

GHC version:

$ ghc-8.2.1 --version
The Glorious Glasgow Haskell Compilation System, version 8.2.0.20170505

These warnings (fixed in my ghc-8.2 branch of bloodhound) may provide a clue to what's happening:

tests/V1/tests.hs:1876:17: warning: [-Wsimplifiable-class-constraints]
    • The constraint ‘SOP.All SOP.SListI (SOP.GCode a)’
        matches an instance declaration
      instance forall k (f :: k -> Constraint) (xs :: [k]).
               (Generics.SOP.Constraint.AllF f xs, SOP.SListI xs) =>
               SOP.All f xs
        -- Defined in ‘Generics.SOP.Constraint’
      This makes type inference for inner bindings fragile;
        either use MonoLocalBinds, or simplify it using the instance
    • In the type signature:
        sopArbitrary :: forall a.
                        (Generic a,
                         SOP.GTo a,
                         SOP.All SOP.SListI (SOP.GCode a),
                         SOP.All2 Arbitrary (SOP.GCode a)) =>
                        Gen a

Change History (1)

comment:1 Changed 2 years ago by dfeuer

I don't think the warning, per se, indicates much. However, there are definitely some strange things going on with these types. Lots of type-level recursion. I had hoped that the fix for the specializer generating loopy code might have done something good here, but as far as I can tell this is still an issue in the released 8.2.1.

Note: See TracTickets for help on using tickets.