Rendering large text. #705

Open
opened 2026-01-29 14:43:29 +00:00 by claunia · 1 comment
Owner

Originally created by @p6laris on GitHub (Nov 19, 2024).

Hi there,

I’m working on a project where I need to render large Markdown documents into HTML using Markdig. The issue I’m running into is performance when re-rendering the entire document after every change. I’d like to optimize this process by only re-rendering the sections that have been modified or added.

I’m wondering if there’s a way to achieve this using or any suggestions?

Cheers.

Originally created by @p6laris on GitHub (Nov 19, 2024). Hi there, I’m working on a project where I need to render large Markdown documents into HTML using Markdig. The issue I’m running into is performance when re-rendering the entire document after every change. I’d like to optimize this process by only re-rendering the sections that have been modified or added. I’m wondering if there’s a way to achieve this using or any suggestions? Cheers.
claunia added the question label 2026-01-29 14:43:29 +00:00
Author
Owner

@xoofx commented on GitHub (Nov 24, 2024):

I’m wondering if there’s a way to achieve this using or any suggestions?

It would require maintaining the previous document model in memory and performing your own diff, and removing the nodes that are the same and then re-render things... but yeah, it will be complicated. You will need to identify where previous blocks map to previous text in order to do a safe replacement. It's possible (e.g. you can hook into the HTML renderer to record the line + associated markdown block)

How large is your input document and how frequent do you have to re-render it?

@xoofx commented on GitHub (Nov 24, 2024): > I’m wondering if there’s a way to achieve this using or any suggestions? It would require maintaining the previous document model in memory and performing your own diff, and removing the nodes that are the same and then re-render things... but yeah, it will be complicated. You will need to identify where previous blocks map to previous text in order to do a safe replacement. It's possible (e.g. you can hook into the HTML renderer to record the line + associated markdown block) How large is your input document and how frequent do you have to re-render it?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#705