Closed parsonsmatt closed 1 year ago
Nice improvement! Though I think the new dependencies will be a problem for GHCs build system as they are not boot libraries and as such GHC can’t bootstrap them.
Is it possible to use the bytestring builder and inline the dlist stuff and use the CPS writer from mtl?
Ah, that's unfortunate! Is there a way to statically ensure that only boot packages are allowed?
I can use the Builder
that's in ByteString
, inline DList
, and pick the later mtl
which has that module - cabal
was giving mysterious errors about it due to the cabal.project
's hackage index state field.
Ah, can't have a newer mtl
just yet due to the GHC boot package requirement. CPPed in the instance definition.
Noticed that this PR also did a nub => ordNub
translation. Tested it out and that was responsible for an inordinate amount of the benefit. I took the liberty of removing the last few nub
calls. No big difference on the persistent
test.
Based on #1541
This PR refactors the
WriterT
logging to use theCPS
version. TheMonadWriter
interface is scrapped in favor of a custom class for reporting errors.ErrMsg
is nowBuilder
instead ofString
.Overall this is a pretty decent improvement in performance. Testing this on the
persistent
repository andpersistent-test
in particular (since that package has a ton of exports and not a lot of docs). You have to remember to do the step twice, because it'll buildpersistent
too on the first time due to configuration changing.plain
With
cabal haddock persistent-test --haddock-options "+RTS -s -RTS"
:This branch
cabal haddock persistent-test --with-haddock=/home/matt/.cabal/bin/haddock --haddock-options "+RTS -s -RTS"
This change alone results in a pretty nice performance improvement. 8 seconds faster to build docs for
persistent-test
, down to 18 seconds from 26 seconds - 30% improvement. Total memory use is ~4% better (not huge, but not nothing). Allocations are way down (42GB to 25GB).