Computing imp_finst can take up significant amount of time
I profiled a build of a production code base with thousands of modules and merging imp_finsts [1] from different imports came up on top taking up 9% of total compile time.
I made a synthetic test case to reproduce the issue (see attached generateModules).
The test case is basically multiple layers of modules where each module defines a type family instance through deriving Generic.
The problem is quite obvious, unionLists is quadratic and imp_finsts just keeps growing with the size of the code base.
Trac metadata
| Trac field | Value |
|---|---|
| Version | |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |