When examining compile times for code with large ADTs (particularly those with
many record constructors), I found that the specialiser contributed
disproportionately to the compiler runtime. Some profiling suggested that
the a great deal of time was being spent in pair_fvs being called from
@simonpj pointed out that flattenDictBinds as called by specBind was
unnecessarily discarding cached free variable information, which then needed to
be recomputed by pair_fvs.
Here I refactor the specializer to retain the free variable cache whenever
- I used fst in a couple of places to extract the bindings from a DictBind. Perhaps this is a sign that DictBind has outgrown its type synonym status?