Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is essentially a copy of #18, with the following minor fixes:
renderHtml'
function was resulting in runtime errors due to negativestimes
multipliers. I fixed this to avoid those."
instead of"
). I changed this so the previous escaping behavior remains.The above were detected by patching Haddock to use this patched xhtml and comparing test suite outputs for the HTML backend. There were no other diffs in Haddock's HTML output for its HTML test suite, other than unicode characters no longer being escaped and being printed literally in the HTML (which I believe is an acceptable change).
Performance
This patch improves Haddock's performance. I have gathered some metrics from the
ghc-9.6
version of Haddock on the Agda codebase with just the HTML backend enabled. I ran haddock under thetime
command and used+RTS -s
.Baseline
The baseline performance metrics, without this patched xhtml, were:
6.73 seconds, 375,499,328 maximum live data residency, 1,256,374,272 maximum total residency, 16,773,106,760 total bytes allocated.
Patched
With Haddock patched to use this patched xhtml, the metrics were:
4.98 seconds, 353,392,488 maximum live data residency, 1,212,792,832 maximum total residency, 17,786,284,096 total bytes allocated.
I consider this an improvement, with the caveat that total bytes allocated is up about 1GB. I have verified that the increase in total bytes allocated is coming from Haddock's HTML pretty-printing. I'm not sure if this is something to be concerned about, given the other performance improvements.