-
-
Notifications
You must be signed in to change notification settings - Fork 77
+200x Performance increase for huge HTML file | Refactor to TextWriter and more #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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+)
|
@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. |
|
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. |
|
@r-Larch I am bit slow on this due to work on other OSS libs (Marten), will definitely get to it this week. |
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.