remarkjs / remark-gfm

remark plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists)
https://remark.js.org
MIT License
744 stars 26 forks source link

Bad performance with long strings with gfm plugin enabled on react-markdown #48

Closed angel-git closed 1 year ago

angel-git commented 1 year ago

Initial checklist

Affected packages and versions

3.0.1

Link to runnable example

No response

Steps to reproduce

https://github.com/angel-git/remark-issue

Expected behavior

When enabling the plugin the render takes around 30 seconds

Actual behavior

It shouldn't take so many seconds to render: image

When removing the plugin like:

 <Markdown remarkPlugins={[]}>{markdownSource}</Markdown>

it renders instantly

is there some setting or something i could do to make it faster?

thanks

Runtime

Node v16

Package manager

npm 8

OS

macOS

Build and bundle tools

Create React App

ChristianMurphy commented 1 year ago

Duplicate of https://github.com/remarkjs/remark-gfm/issues/45, https://github.com/micromark/micromark-extension-gfm-table/issues/6, and https://github.com/micromark/micromark-extension-gfm-table/issues/9 The response continues to be:

There is also a need for a completely compliant and safe markdown parser. AFAIK few parsers are as correct in edge cases as micromark. If performance is really important, consider looking at the Rust version of micromark: https://github.com/wooorm/markdown-rs

If you have specific recommendations on improving performance while keeping inline with GFM spec and being a safe parser, those recommendations are welcome.

github-actions[bot] commented 1 year ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

github-actions[bot] commented 1 year ago

Hi! Thanks for taking the time to contribute!

Because we treat issues as our backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn’t an exact duplicate but is closely related.

Thanks, — bb

github-actions[bot] commented 1 year ago

Hi team! It seems this post is a duplicate, but hasn’t been marked as such. Please post a comment w/ Duplicate of #123(no final .) to do so. See GH docs for more info.

Thanks, — bb