
#12357: Increasing maximum constraint tuple size significantly blows up compiler allocations -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: 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:D2400 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari):
Data con workers seems similarly specialised. It's just an encoding for a large family. Maybe 11b for rep-name?
Fair enough. Alright; I'll move ahead with this option then.
On second thought, this is actually not entirely trivial; to see why, consider what happens when you are writing out the interface file of `GHC.Tuple`. Under the proposal, you would need to somehow recognize type representations (which are plain value-level bindings) which belong to a tuple type and encode them with the special symbol table encoding. Indeed we already do this for encoding `TyCon` names and it's not hard: just look for `TyCon`s with `algTcRhs = TupleTyCon {}` (as is done by `tyConTuple_maybe`). However, distinguishing a value level binding as a tuple's type rep is not as easy. I can think of two options neither being terribly nice, 1. Build a `Map TypeRepName TupleSort` and check it for every symbol that we write to the symbol table (yuck) 2. Add a constructor to `IdDetails` to encode the fact that the binding is the typerep of a tuple -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12357#comment:29 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler