The hi-haddock work (including a lot of memory optimizations) is now merged into the ghc-9.6 branch the Haddock GitHub repository. This MR ports the work to ghc-head.
ghc-9.6
ghc-head