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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watchdog autosave feature causes performance problems #13098

Closed
scofalik opened this issue Dec 19, 2022 · 0 comments 路 Fixed by #14563
Closed

Watchdog autosave feature causes performance problems #13098

scofalik opened this issue Dec 19, 2022 · 0 comments 路 Fixed by #14563
Assignees
Labels
squad:collaboration Issue to be handled by the Collaboration team. support:2 An issue reported by a commercially licensed client. type:improvement This issue reports a possible enhancement of an existing feature.

Comments

@scofalik
Copy link
Contributor

scofalik commented Dec 19, 2022

馃摑 Provide a description of the improvement

One of the most important Watchdog feature is restarting the editor when there is an unhandled error. To prevent losing the editor data, the watchdog internally saves the editor data, so it is able to restore it after the editor is restarted.

The problem is that this can lead to performance problems. The saving is done differently than in autosave feature. Instead of debouncing the save event on editor change (as in autosave), the watchdog throttles it. This means that for big documents, there will be a lag on first typed character and then after every 5 seconds as the user keeps on typing.

This puts further pressure on applications which handle big documents and additionally use autosave feature.

What's more, saving data by watchdog does not make any sense if the editor is used in real-time environment as the data is taken from the remote CS session anyway. But there's no setting to prevent the saves. This can be probably "hacked" by setting saveInterval to 2147483647 (this is the biggest value that can be used in JS timeouts). This should be either described in the documentation or even maybe watchdog should overwrite this setting if RTC is used.

One possible way to improve watchdog performance is to save model state (+markers) instead of document data. Since we are restarting the editor using the same configuration, it should be safe to use the model and it should be faster to save and re-init the editor. One problem here is that incorrectly implemented custom features may be saving some important data outside of the model (this can happen in non-RTC integrations, as in RTC applications this kind of bug should can show up faster as the non-model data is not shared among users).

@scofalik scofalik added type:improvement This issue reports a possible enhancement of an existing feature. squad:collaboration Issue to be handled by the Collaboration team. labels Dec 19, 2022
@scofalik scofalik self-assigned this Dec 19, 2022
@CKEditorBot CKEditorBot added the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Dec 19, 2022
@martynawierzbicka martynawierzbicka added the support:2 An issue reported by a commercially licensed client. label Feb 1, 2023
@CKEditorBot CKEditorBot added status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Feb 21, 2023
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. labels Mar 7, 2023
@scofalik scofalik assigned DawidKossowski and unassigned scofalik and kbinieda Jul 7, 2023
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Jul 11, 2023
scofalik pushed a commit that referenced this issue Jul 20, 2023
Fix (watchdog): Improved the Watchdog save mechanism performance to prevent editor unresponsiveness ("lags") while editing the document. Closes #13098.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Jul 20, 2023
@CKEditorBot CKEditorBot added this to the iteration 65 milestone Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad:collaboration Issue to be handled by the Collaboration team. support:2 An issue reported by a commercially licensed client. type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants