+200x Performance increase for huge HTML file | Refactor to TextWriter and more#410
Merged
Merged
Conversation
Run tests for: - net471: To check NetStandardPolyfills (run for netframework - net5) - net6.0: To check net6.0 branches (runs for net.6, net7, net8) - net9.0: To test default implementation (runs for net9+)
Owner
|
@r-Larch Appreciate you taking the time to improve performance of the lib by using text writer. But the changes are just too massive that it is going to take a quite a lot of my time for me to check through them. Anyhow, I will see if I can review by next week or so. |
Contributor
Author
|
I see the tests are failing in GitHub actions because of nuget package version outside of dependency constraint in the test project for the targetframework net471. |
Owner
|
@r-Larch I am bit slow on this due to work on other OSS libs (Marten), will definitely get to it this week. |
This was referenced Jan 12, 2026
This was referenced Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi,
This PR brings massive performance at the cost of some breaking changes in the
IConverterinterface and all derived types.Key Changes:
Verify.Xunitis not available for it.ReverseMarkdown.Benchmarkto run benchmarks.Note: I suggest dropping support for legacy target frameworks after the net10 release on November 11th.
Dropping legacy support basically means reverting commit b9164ce (makes the code easier to maintain)
Take a look at the benchmark below and note the speed and memory difference.
I tested:
Please feel free to merge or close.
I fully understand if you don't like to introduce the breaking changes.
Kind regards
René
Comparing ReverseMarkdown v4.7.1 vs TextWriter approach
Hardware: AMD Ryzen 9 3900X 3.80GHz, 24 cores, 12 physical cores
Job=.NET 9.0 Runtime=.NET 9.0
YYRunning with
Files/1000-paragraphs.htmlfile (size: 442KB) and1000paragraphs.Outliers:
Running with
Files/10k-paragraphs.htmlfile (size: 3.7MB) and10kparagraphs.Outliers:
Running with
Files/huge.htmlfile (size: 16MB) and41312paragraphs.