mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
[PR #499] [CLOSED] Random perf improvements #1066
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/xoofx/markdig/pull/499
Author: @MihaZupan
Created: 12/17/2020
Status: ❌ Closed
Base:
master← Head:random-perf📝 Commits (7)
f453545Avoid minor allocations in ProcessInlines loopab358b5Minor codegen improvements2af8b1fCache default MarkdownPipelinec776d18Avoid delegate allocations in AutoIdentifierExtensionc8a467cRemove unnecessary indirection20f1ae2Reduce the size of MarkdownObject by 1 pointer sizef8f3402Cache HtmlRenderer also for custom TextWriters📊 Changes
26 files changed (+430 additions, -319 deletions)
View changed files
📝
src/Markdig.Tests/TestMarkdigCoreApi.cs(+101 -62)📝
src/Markdig/Extensions/Abbreviations/AbbreviationParser.cs(+1 -1)📝
src/Markdig/Extensions/AutoIdentifiers/AutoIdentifierExtension.cs(+35 -23)📝
src/Markdig/Extensions/GenericAttributes/GenericAttributesParser.cs(+2 -2)📝
src/Markdig/Extensions/SmartyPants/SmartyPantsInlineParser.cs(+1 -1)📝
src/Markdig/Extensions/Tables/GridTableParser.cs(+7 -6)📝
src/Markdig/Extensions/Tables/PipeTableParser.cs(+1 -1)📝
src/Markdig/Extensions/Tables/TableHelper.cs(+2 -2)📝
src/Markdig/Extensions/TaskLists/TaskListInlineParser.cs(+1 -1)📝
src/Markdig/Helpers/HtmlHelper.cs(+8 -8)📝
src/Markdig/Helpers/ICharIterator.cs(+12 -1)📝
src/Markdig/Helpers/LinkHelper.cs(+8 -8)📝
src/Markdig/Helpers/StringLineGroup.cs(+6 -2)📝
src/Markdig/Helpers/StringSlice.cs(+11 -0)📝
src/Markdig/Markdown.cs(+46 -38)📝
src/Markdig/MarkdownPipeline.cs(+51 -16)📝
src/Markdig/Parsers/BlockProcessor.cs(+1 -1)📝
src/Markdig/Parsers/HtmlBlockParser.cs(+1 -1)📝
src/Markdig/Parsers/Inlines/EmphasisInlineParser.cs(+1 -1)📝
src/Markdig/Parsers/Inlines/EscapeInlineParser.cs(+2 -2)...and 6 more files
📄 Description
Codegen tweaks and allocation improvements.
Removing the overheads in the simple
Markdown.ToHtml(...)case with the default pipeline.For an empty string allocations go from 17.14 KB to 928 B and take 1/20th the time because of the default pipeline caching (
2af8b1f) - means we're now benefiting from the Renderer caching fromafe4308e91in the basic use cases.For
c776d18I was quite surprised how bad the compiler is at avoiding these allocations :/🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.