
#14254: The Binary instance for TypeRep smells a bit expensive -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Typeable Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3998, Wiki Page: | Phab:D4078, Phab:D4082 -------------------------------------+------------------------------------- Comment (by dfeuer): One more thing: while I don't think it's a good idea, we ''could'' go with a version of Phab:D4085 that only caches kind typereps in `TrTyCon` constructors. That would eliminate the allocation problem and alleviate but not eliminate the time problem. The reason I favor the fully cached version is that it doesn't strike me as really that expensive to add one more pointer to a constructor that already has four words of payload (two for the `Fingerprint`, one for the function, and one for the argument). However, that's somewhat conditional on being able to eliminate the extra laziness. It seems there's a knot that needs tying for `Type :: Type`, which makes things a tad fussy. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14254#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler