Closed parsonsmatt closed 1 year ago
I'm pretty sure this is because `persistent-test has ```-XTemplateHaskell in the default-extensions. You need to run TH splices in order to typecheck a module (and hence generate documentation) and hence you need code generation.
Huh, you're right. TemplateHaskell
implies code generation, even if the file doesn't have any TemplateHaskell
use. Setting `{-# LANGUAGE NoTemplateHaskell{,Quotes}, NoQuasiQuotes #-} does disable the codegen phase and save a bunch of time.
I'll update the ticket title.
Oh, you know what, -fprefer-byte-code
is probably exactly what we want here, isn't it? 😄
I did a profiling run with the
persistent-test
and got this profiteur resultThe time is completely dominated by code generation. 63% of time and 67% of allocations!
I'm passing
--optghc=-fno-code
and even trying to set theDynFlags
to not build code, but it's ignoring it.With the output from
withTimings
, here's an example module:The module in question doesn't even use
TemplateHaskell
, so that can't be it.processModule
(the code that Haddock actuall needs) only takes 0.66ms. Meanwhile theCodeGen
takes 228ms. If we could eliminateCodeGen
step, then we could save an enormous amount of time.Saving this issue as a follow-up point for later...