Avoid unnecessary allocations due to tracing utilities
While ticky-profiling the typechecker I noticed that hundreds of millions of SDocs are being allocated just in case -ddump-*-trace is enabled. This is awful. We avoid this by ensuring that the dump flag check is inlined into the call site, ensuring that the tracing document needn't be allocated unless it's actually needed. See Note [INLINE conditional tracing utilities] for details. Fixes #18168.
parent
fdcb8f73
Pipeline #19221 failed
Stage: lint
Stage: quick-build
Stage: build
Stage: full-build
Stage: cleanup
Stage: packaging
Stage: testing
Showing
- compiler/GHC/Core/Opt/Simplify/Monad.hs 1 addition, 0 deletionscompiler/GHC/Core/Opt/Simplify/Monad.hs
- compiler/GHC/Core/Unfold.hs 7 additions, 1 deletioncompiler/GHC/Core/Unfold.hs
- compiler/GHC/HsToCore/PmCheck/Oracle.hs 1 addition, 0 deletionscompiler/GHC/HsToCore/PmCheck/Oracle.hs
- compiler/GHC/Tc/Solver/Flatten.hs 1 addition, 0 deletionscompiler/GHC/Tc/Solver/Flatten.hs
- compiler/GHC/Tc/Solver/Monad.hs 4 additions, 0 deletionscompiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Utils/Monad.hs 46 additions, 12 deletionscompiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Utils/Error.hs 19 additions, 9 deletionscompiler/GHC/Utils/Error.hs
Loading
Please register or sign in to comment