Use a more efficient representation than [DynFlag]
compiler/typecheck/TcRnMonad.lhs, if I replace the existing definitions with
traceOptIf _ _ = return () traceOptTcRn _ _ = return () dumpTcRn _ = return ()
then we see an improvement in nofib's "Compile Times" sections:
-1 s.d. ----- -8.5% +1 s.d. ----- +1.8% Average ----- -3.5%
By using some sort of bitmap representation, we ought to see a modest compile time improvement from all the checks that the trace functions make, as well as various other checks that are made (do we need to warn about missing sigs, are overlapping instances allowed, etc).
The tricky bit is designing it so that it is hard to shoot yourself in the foot.
Lexer.x already has a bitmap (
ffiBit etc) but the mapping of feature to bit number is done by hand, which isn't ideal. Perhaps this is even important enough to deserve a language extension?