Skip to content

Web-Editor chokes on larger texts (performance issue) #908

Open

Description

@fwolfst

Describe the bug
Editing (e.g. marking a word and making it bold) is slowed down significantly, when the text is big.

To Reproduce

  1. Visit NextCloud in browser
  2. Click on "New Text Document" and enter a name
  3. Copy a larger chunk of text
    3.1. e.g. visit https://en.wikipedia.org/wiki/History_of_England, CTRL+A to mark all text, CTRL+C to copy
    3.2. CTRL+V a couple of times in nextcloud
  4. Mark a word and click on b/bold
  5. Alternatively, mark all text in the markdown viewer (e.g. mouse-based, or CTRL+A) and do the same.

(Notice the lags.)

Nextcloud version: 18.0.6

Browser log

In my case, the sync POST request shows ~1 KB of data. After clicking on the "make bold" icon, it takes a second until the text is displayed in bold (and a 806 byte push event). The longer the text, the more laggy does the UI seem to be. I had a user jump back to google docs because of that :( . The same text felt snappier in Collabora Online/Office.

It seems that the lags occur through client based processing, as push event is shown in the network log only after the second(s) of delay, but here I do not have enough insights into how and when the logging is done (only after all processing?).

Activity

  1. fwolfst commented on Jun 27, 2020

    @fwolfst
    Author
  2. changed the title [-]Web-Editor chokes on larger texts[/-] [+]Web-Editor chokes on larger texts (performance issue)[/+] on Jun 28, 2020
  3. juliusknorr commented on Jul 15, 2020

    @juliusknorr
    Member

    Could you share some details on which browser/OS you are using, as I cannot see any concrete performance issue with a 500kb contatining that wikipedia article multiple times.

  4. fwolfst commented on Jul 15, 2020

    @fwolfst
    Author

    Could you share some details on which browser/OS you are using, as I cannot see any concrete performance issue with a 500kb contatining that wikipedia article multiple times.

    Sure. My document is ~560kb. Firefox 78.0.2 (64-bit), XUbuntu 18.04 (although not using xfce).
    I have to say that the lag now is considerably smaller than when reported, and it believe it makes a difference whether the change is done in the beginning of the document vs at the end of the document.
    Still, pressing CTRL+A (to mark all text) lets firefox report me that a page is slowing down my browser and asking whether I want to stop it.

  5. max-nextcloud commented on Aug 29, 2022

    @max-nextcloud
    Contributor

    @a4bits that sounds like a different issue entirely. Are you still seeing this? Please open a new issue for it and include your app version.

  6. max-nextcloud commented on Aug 29, 2022

    @max-nextcloud
    Contributor

    @fwolfst Could you try again with a recent version of Nextcloud? I think the responsiveness of large files has improved a lot except for a few corner cases.

    I just tried this on our Nextcloud 24 instance and had no sluggishness what so ever - however I'm running on a fairly fast computer and the server has quite a bit of resources too. So would be nice if you could try to confirm.

  7. luka-nextcloud commented on Nov 6, 2022

    @luka-nextcloud
    Contributor

    I copied the big data from the wiki link in the description of the task and then pasted it into the md file. It causes lag when clicking on the icon bold and when scrolling.

  8. moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity teamon Oct 28, 2026
  9. moved this from 🧭 Planning evaluation (don't pick) to 📄 To do (~10 entries) in 📝 Productivity teamon Oct 28, 2026
  10. blizzz commented on Oct 28, 2026

    @blizzz
    Member

    Today, after I report, I tried with a 500kB file (essentially a big long table), and it was already quite laggy as well. On Firefox.

    Another report claimed a 900kb file (with three dozen images and a table) being practically unusable (also on Firefox).

  11. max-nextcloud commented on Nov 2, 2026

    @max-nextcloud
    Contributor

    Would be good to do some profiling of a slow editing session to see what's keeping the editor busy.
    I remember we used to serialize the document on every update - i.e. in on every keystroke. Not sure if we still do this but it's the first thing I would check for.

  12. mejo- commented on Nov 2, 2026

    @mejo-
    Member

    I asked Claude the following:

    We have a report #908 about Text frontend becoming laggy with large documents (500kb or more). Can you please test this yourself against nextcloud.local with documents with different contents (long simple markdown, long tables, many attachments) and identify what's the bottleneck and what we can do about it?

    Here's it's answer:

    What's slow

    1. The whole document is converted to markdown on every keystroke (CollaborativeEditor.vue:679, the onUpdate handler). That conversion is also quadratic in Chromium: prosemirror-markdown 1.13.9 checks the last character of its output after every write, and Chromium's JS engine copies the whole growing string each time it does. It takes 850 ms at 500 kB and 3.7 s at 1 MB. Firefox doesn't have this problem (9 ms). In the default Files/Viewer setup nothing uses the result of the per-keystroke conversion. This is what Max suspected in the issue.
    2. The nested-table check on every edit (src/nodes/Table/TableCell.ts:64) walks the whole document and looks up the position of every table, row and cell. That lookup is itself linear, so long tables cost about 300 ms per keystroke here.
    3. Every table row is its own Vue component (TableRowView with its own actions menu). Tiptap makes each one recompute its position on every cursor move, and that is linear too. On the 2,260-row table this costs 50 ms in Chromium and 110–170 ms in Firefox per keystroke or arrow key. When I removed those listeners in the page, Firefox went from 170 to 44 ms for arrow keys and to about 100 ms for typing. The class involved isn't exported by Tiptap, so Text can't override it.

    It also came with concrete code changes to tackle some of the detected issues. @silverkszlo shall we have a look together or shall I open a PR and we discuss the changes from there?

  13. mejo- commented on Nov 9, 2026

    @mejo-
    Member

    The Markdown serialization bottleneck was addressed upstream in ProseMirror with https://code.haverbeke.berlin/prosemirror/prosemirror-markdown/commit/85f196373989569aff723dadb7d742a2d8d1caba and in Text with #9525.

    For improving performance with many Tiptap vue node views, I opened ueberdosis/tiptap#8705.

  14. self-assigned this
    on Nov 9, 2026
  15. moved this from 📄 To do (~10 entries) to 🏗️ In progress in 📝 Productivity teamon Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions