-
Notifications
You must be signed in to change notification settings - Fork 37
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
Compilation for big datatypes with Generics is quite slow #5
Comments
I have done (2), and unfortunately, the TH generated instances take a long time to compile as well. I have an idea of how to resolve it:
|
Most likely due to https://ghc.haskell.org/trac/ghc/ticket/5642 |
Actually, I don't think it's the quadratic typechecking thing, though that probably isn't helping much. I can load store into ghci in less than 10 seconds, so it must be the amount of work done during optimization / codegen. I can rule out the problem being codegen by just doing |
Wow, somewhere along the line the full time to build store crept up to This can be further dropped to With INLINEs removed:
Whereas with INLINE pragmas:
So I think it's worth keeping those INLINEs for now. Note that the extra 30s is mostly due to using this generic deriving stuff on some quite large datatypes - all the TH types. |
I closed it due to the drastic improvement. However, we may still want to revisit this. |
Currently,
Data.Store.Instances
uses GHC generics to defineStore
instances for all TH datatypes. This makes the module take 1 minutes 40 seconds to compile instead of 15 seconds.I'm thinking we should do the following:
Add a clear warning to the docs that using generics for this will slow down your compile times quite a lot
Implement TH definition of Store instances
The text was updated successfully, but these errors were encountered: