Skip to content
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

Cache the MarkdownParser & Processors #529

Merged
merged 2 commits into from
Mar 15, 2021
Merged

Conversation

MihaZupan
Copy link
Collaborator

  • MarkdownParser is made static (had private ctor before)
  • Block/InlineProcessor got a set of Setup/Rent/Reset/Release methods
Markdown.Parse("Hello world!");

Before:
image

After:
image

@MihaZupan
Copy link
Collaborator Author

MihaZupan commented Mar 12, 2021

I think this makes us free of "Constant overhead" in terms of allocations on the Parse/ToHtml paths.

/// <summary>
/// Gets the new blocks to push. A <see cref="BlockParser"/> is required to push new blocks that it creates to this property.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the order of the properties are all changed in this file? Could this be done in a separate PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah I can try to revert this part. I was doing it to triple-check all state was getting reset

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed back to original order

@xoofx xoofx merged commit 7ad7b55 into xoofx:master Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants