text icon indicating copy to clipboard operation
text copied to clipboard

Web-Editor chokes on larger texts (performance issue)

Open fwolfst opened this issue 5 years ago • 6 comments

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?).

fwolfst avatar Jun 27 '20 22:06 fwolfst

I also posted this in https://help.nextcloud.com/t/built-in-document-editor-chokes-on-medium-sized-files/85684 (no answer in the last two days).

fwolfst avatar Jun 27 '20 22:06 fwolfst

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.

juliusknorr avatar Jul 15 '20 11:07 juliusknorr

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.

fwolfst avatar Jul 15 '20 18:07 fwolfst

more details seems like path /index.php/apps/text/session/create?fileId=<ID>&filePath=<FILE>&guestName=null&forceRecreate=false either takes very long to load or comes out with error

"An exception occurred while executing 'INSERT INTO oc_text_documents (id, last_saved_version_time, last_saved_version_etag, base_version_etag) VALUES(?, ?, ?, ?)' with params [<ID>, 1601478775, "be32176e6f31380889fc6f9462c2422e", "be32176e6f31380889fc6f9462c2422e"]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '<ID>' for key 'PRIMARY'"

and its not only on big files

a4bits avatar Oct 01 '20 01:10 a4bits

@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.

max-nextcloud avatar Aug 29 '22 08:08 max-nextcloud

@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.

max-nextcloud avatar Aug 29 '22 08:08 max-nextcloud

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.

luka-nextcloud avatar Nov 06 '22 20:11 luka-nextcloud