[PR #499] Random perf improvements #1070

Open
opened 2026-01-29 14:49:19 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/xoofx/markdig/pull/499

State: closed
Merged: No


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 from afe4308e91 in the basic use cases.

For c776d18 I was quite surprised how bad the compiler is at avoiding these allocations :/

**Original Pull Request:** https://github.com/xoofx/markdig/pull/499 **State:** closed **Merged:** No --- 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 from https://github.com/lunet-io/markdig/commit/afe4308e918b8afa5d5359d2fab270b4621ef3ab in the basic use cases. For c776d18 I was quite surprised how bad the compiler is at avoiding these allocations :/
claunia added the pull-request label 2026-01-29 14:49:19 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#1070