Optimise typeKind and TyCon
This ticket records two ideas
-
TyCon
is a sum of six constructors. That means that eventyConUnique
requires a six-way branch to get the unique. Moreover quite a few fields are common across all the constructors:Name
,Unique
,[TyConBinder]
etc. So it might be better to representTyCon
as a tuple of all its common fields, with the last field being a 6-way sum for the details.See branch
wip/T21623-tycon
and !9351 (closed). See also #22503 (closed)Status: done, landed
-
typeKind
is a heavily used function, but I think it can be made faster. NotablytypeKind (TyConApp tc tys) = piResultTys (tyConKind tc) tys
does more work than necessary, esp in the case where the TyCon is saturated and has a closed kind.
Status: stalled:: I have a branch
wip/T21623-faster
but puzzlingly it doesn't go faster; it goes slower! I lack the cycles to pursue this, so I'm parking it for now