Optimise typeKind and TyCon
This ticket records two ideas
-
TyConis a sum of six constructors. That means that eventyConUniquerequires 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 representTyConas a tuple of all its common fields, with the last field being a 6-way sum for the details.See branch
wip/T21623-tyconand !9351 (closed). See also #22503 (closed)Status: done, landed
-
typeKindis a heavily used function, but I think it can be made faster. NotablytypeKind (TyConApp tc tys) = piResultTys (tyConKind tc) tysdoes 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-fasterbut puzzlingly it doesn't go faster; it goes slower! I lack the cycles to pursue this, so I'm parking it for now