Opened 20 months ago

Last modified 18 months ago

#14766 new bug

Hole-y partial type signatures greatly slow down compile times

Reported by: harpocrates Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.2.1
Keywords: PartialTypeSignatures 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 (last modified by harpocrates)

This time, I actually mean it. :)

Originally reported here, I distilled the example from this comment into a one file test case. Sigs.hs is exactly like NoSigs.hs, except for the fact that it has a bunch of extra type signatures that have a lot of holes. On my machine, this is what compilation times are (I gave up timing after 15 minutes):

GHC version 8.0.2 8.2.1 8.4.1 (445554b6d9a2263f969e25bb9f532dd0c3a9dc8c)
NoSigs.hs 24.13s 22.93s 34.05s
Sigs.hs >15m ~13m >15m

Attachments (2)

NoSigs.y (13.1 KB) - added by harpocrates 20 months ago.
Sigs.y (13.0 KB) - added by harpocrates 20 months ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 20 months ago by simonpj

Fantastic. Where can I find Sigs.hs and NoSigs.hs?

Changed 20 months ago by harpocrates

Attachment: NoSigs.y added

Changed 20 months ago by harpocrates

Attachment: Sigs.y added

comment:2 Changed 20 months ago by harpocrates

Unfortunately, Sigs.hs and NoSigs.hs are too big to upload. Here they are on GitHub gists. Alternately, you can generate them (or rather generate very similar files, modulo some CPP) via:

$ happy-1.19.8 -agc Sigs.y -o Sigs.hs
$ happy-1.19.8 -agc NoSigs.y -o NoSigs.hs

Note that you _must_ use happy version 1.19.8 or later. Sorry for any confusion!

comment:3 Changed 20 months ago by harpocrates

Description: modified (diff)

comment:4 Changed 20 months ago by simonmar

How does this relate to #14683?

comment:5 in reply to:  4 Changed 20 months ago by harpocrates

Replying to simonmar:

How does this relate to #14683?

The issues are AFAICT unrelated. The Happy issue is really about this - it just so happens that while attempting to reproduce that issue, I stumbled on #14683 (and incorrectly assumed it too was partial-type-signature related).

comment:6 Changed 18 months ago by simonpj

Keywords: PartialTypeSignatures added
Note: See TracTickets for help on using tickets.