matchInstEnv accounts for 50% of typechecker time
I created a profile of GHC compiling a large commercial project and noticed that matchInstEnv
accounted for 50% of time spent typechecking the project. That seems like rather a lot. Zooming into just matchInstEnv
..
It seems that the cost is split quite evenly between tc_unify_tys_fg
, tc_match_tys
and $instIsVisible
, instIsVisible
looks quite cheap so I wondered if this function is getting hammered an ungodly number of times.