Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Source project has a limited visibility.
user avatar
Simon Peyton Jones authored
As #19668 showed, there was an /asymptotic/ slow-down in zonking in
GHC 9.0, exposed in test T9198.  The bug was actually present in earlier
compilers, but by a fluke didn't actually show up in any of our tests;
but adding Quick Look exposed it.

The bug was that in zonkTyVarOcc we
1. read the meta-tyvar-env variable
2. looked up the variable in the env
3. found a 'miss'
4. looked in the variable, found `Indirect ty`
5. zonked `ty`
6. update the env *gotten from step 1* to map the variable
   to its zonked type.

The bug is that we thereby threw away all teh work done in step 4.
In T9198 that made an enormous, indeed asymptotic difference.

The fix is easy: use updTcRef.

I commented in `Note [Sharing when zonking to Type]`

-------------------------
Metric Decrease:
    T9198
-------------------------
0a8c14bd
History
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Name Last commit Last update
..