Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This work aims at solving a couple of performance issues with the Generic ToJSON instances where inlining is incomplete. As a result the generated code contains a number of references to Generic Rep types and to Aeson's generic helpers, which breaks the structure of the code and slows down both compilation and execution, especially for large types.
Commit message
Generic implementation should use inlining when possible
in order to eliminate Generic sum/product combinators
in final generated code.
The simplifications can actually lead to smaller code and faster
compilation.
Compilation time (GHC 8.4):
Runtime performance:
(same as BigRecord/toJSON/th)
(still almost 2x slower than BigProduct/encode/th
The same approach dose not improve GFromJSON due to the presence
of unsaturated applications.