[commit: ghc] wip/ttypeable: More notes (25fcb3d)
git at git.haskell.org
git at git.haskell.org
Mon Feb 13 15:16:57 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/ttypeable
Link : http://ghc.haskell.org/trac/ghc/changeset/25fcb3d591c2b3f843e941a5c885525542e89e8b/ghc
>---------------------------------------------------------------
commit 25fcb3d591c2b3f843e941a5c885525542e89e8b
Author: Ben Gamari <ben at smart-cactus.org>
Date: Sun Feb 12 19:33:10 2017 -0500
More notes
>---------------------------------------------------------------
25fcb3d591c2b3f843e941a5c885525542e89e8b
compiler/typecheck/TcTypeable.hs | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/compiler/typecheck/TcTypeable.hs b/compiler/typecheck/TcTypeable.hs
index 4605c39..e7fe588 100644
--- a/compiler/typecheck/TcTypeable.hs
+++ b/compiler/typecheck/TcTypeable.hs
@@ -111,6 +111,25 @@ There are many wrinkles:
representations for TyCon and Module. See GHC.Types
Note [Runtime representation of modules and tycons]
+* The KindReps can unfortunately get quite large. Moreover, the simplifier will
+ float out various pieces of them, resulting in numerous top-level bindings.
+ Consequently we mark the KindRep bindings as noinline, ensuring that the
+ float-outs don't make it into the interface file. This is important since
+ there is generally little benefit to inlining KindReps and they would
+ otherwise strongly affect compiler performance.
+
+* Even KindReps aren't inlined this scheme still has more of an effect on
+ compilation time than I'd like. This is especially true in the case of
+ families of type constructors (e.g. tuples and unboxed sums). The problem is
+ particularly bad in the case of sums, since each arity-N tycon brings with it
+ N promoted datacons, each with a KindRep whose size also scales with N.
+ Consequently we currently simply don't allow sums to be Typeable.
+
+ In general we might consider moving some or all of this generation logic back
+ to the solver since the performance hit we take in doing this at
+ type-definition time is non-trivial and Typeable isn't very widely used. This
+ is discussed in #13261.
+
-}
-- | Generate the Typeable bindings for a module. This is the only
More information about the ghc-commits
mailing list