ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.73k stars 337 forks source link

Editing codeblocks with > 30k lines is slow in Chromium #1293

Closed max-nextcloud closed 2 years ago

max-nextcloud commented 2 years ago

Steps to reproduce:

If you have a fast computer you might need to paste more text. Observed this on a Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz.

Firefox seems fine from what i could observe.

Why would one have a 40k line long code block? In @nextcloud/text we are using code blocks to render the content of plain text files and code files. People are complaining about this in particular in the context of opening log files that can easily be much larger.

marijnh commented 2 years ago

How responsive is editing the same document as a plain contentEditable element?

max-nextcloud commented 2 years ago

Oh my... you are right. It's already slow when opening a plain contentEditable from a plain html file.

max-nextcloud commented 2 years ago

I seems to become more responsive when splitting the single <pre><code></code></pre> block into multiple separate code blocks.

@marijnh I guess working around such a performance issue in chrome is outside of the scope of prosemirror - or what do you think?

marijnh commented 2 years ago

Yes, I do indeed consider this out of scope. If someone finds a low-impact kludge that could help here I'd be interested in taking a look, but as a rule, the library doesn't take responsibility for browser performance issues.