Skip to content

Remove the Generic instance for LicenseId #8117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 7, 2022

Conversation

Kleidukos
Copy link
Member

@Kleidukos Kleidukos commented Apr 30, 2022

This was one of the main culprits when analysing the resources taken
by GHC when compiling lib:Cabal.

Is related to #8074.


This is what the timings look with, and without the instance:

image

then

45htwie6


Please include the following checklist in your PR:

Please also shortly describe how you tested your change. Bonus points for added tests!

@Kleidukos Kleidukos force-pushed the remove-licenseid-generic-instance branch from a5e7db1 to 1f37abc Compare April 30, 2022 13:10
@Kleidukos Kleidukos force-pushed the remove-licenseid-generic-instance branch from 1f37abc to 704c660 Compare April 30, 2022 13:16
@Mikolaj
Copy link
Member

Mikolaj commented Apr 30, 2022

Why is Setup trying to make up for the LicenseId speedup?

@Kleidukos
Copy link
Member Author

Good question, this is indeed quite puzzling.

@andreasabel
Copy link
Member

Upstream (GHC) issue: https://gitlab.haskell.org/ghc/ghc/-/issues/16577

@andreasabel
Copy link
Member

andreasabel commented May 4, 2022

@Kleidukos @gbaz: I just had another idea: If a large enum-type is problematic for GHC's deriving mechanism, how about breaking it up into smaller bits, and restore the original interface using PatternSynonyms?
This way maybe we can have the cake and eat it, too.

I suppose since GHC's stock deriving mechanism does not support nested enum types, one would have to code the Enum and Bounded instances for the composite type manually from the derived instances of the components.

@Kleidukos
Copy link
Member Author

@andreasabel It's an interesting solution, could you show us some benchmarks? I used https://github.com/codedownio/time-ghc-modules

@gbaz
Copy link
Collaborator

gbaz commented May 5, 2022

i think that idea is a lot of work for an instance that nobody really seems to need that much :-)

@andreasabel
Copy link
Member

@andreasabel It's an interesting solution, could you show us some benchmarks?

Na. It is an idea, but I don't have the resources to follow up on it.

Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Let's merge.

@Kleidukos Kleidukos added squash+merge me Tell Mergify Bot to squash-merge and removed attention: needs-review labels May 6, 2022
@mergify mergify bot merged commit 203d440 into haskell:master May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squash+merge me Tell Mergify Bot to squash-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants