-
Notifications
You must be signed in to change notification settings - Fork 77
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Very slow with large text #42
Comments
I can confirm it. I've just loaded 800 paragraphs as initial editor content and the editor became incredibly slow. It doesn't happen in CKEditor 5 without Vue integration. @oleq, could you take a look at this one? |
I confirm the issue. The culprit is this listener Lines 101 to 106 in 1dc60f8
getData that makes it slow. We should probably debounce it.
|
Dunno how it works in Vue, so sorry for a potentially stupid question – can the content be retrieved only on demand? Or does Vue implement a sort of two-way-binding so it can't? BTW, I'd consider something like: this.$emit( 'input', () => editor.getData(), evt, editor ); So, instead of passing Sorry again if I'm missing the point :D For two-way data binding debouncing seems reasonable. |
@Reinmar I'm afraid it is impossible. 2-way data binding depends on actual data and there's no way to do things on demand. However, in the PR I managed to reduce the number of In the second step, I'm gonna investigate a possibility of debouncing. Stay tuned. |
I updated the PR with a debounced |
Fix: Improved performance when editing large content. Debounced the component `#input` event. Closes #42.
It would be nice to know if the editor is currently being "debounced" so a form submission can be delayed. Maybe setting a variable "typing" to true? Or at least setting a "maxWait"... |
Something like – |
BTW, perhaps we could use the |
I just encountered this issue today in Vue.js. I get a half- to full-second delay while typing, making for a frustrating staccato, stop-and-go experience. Is there a mitigation for this, perhaps not using CKEditor as a Vue component and just loading it as a pure native build? |
@awmartin could you open a new ticket (and cc me there)? I suppose that there must be an option to disable the two-way data binding or a smarter debounce mechanism (e.g. similar to the one used by autosave). Also, a related ticket in CKEditor 5 itself: ckeditor/ckeditor5#5812. |
Can anyone share some update on this please? |
What about @ready="onReady" --> onReady(editor) { const data = editor.getData() } and skip the v-model? Possibly tying it to various events through editor.editing.view.document.on("event", (evt, data) => {}) |
I forgot to open another ticket. :-( For context, I use a doc with about 6000 words and a lot of paragraphs and list items to test. The delay is typically 600-700ms when it appears. I think the performance of To bypass the The other approach I tried was just increasing the debounce interval to 3000ms. It seemed to be okay except for a couple of hiccups, which I couldn't quite track down. |
still very slow on document editor |
I've tried embedding ClassicEditor in a clean vue project: everything is OK, but when I paste a long flat text (not formatted, just 800 lines long text) the editor became veeery slow (several seconds just to type a character and see it on screen). The same text pasted in your online (not vue) examples works without problems. After deleting all the text, editing is again responsive.
Removing "v-model" tag (thinking about a slowdown keeping the model in sync) didn't help
Tried with latest Chrome on Windows and Linux
My page is as simple as that:
The text was updated successfully, but these errors were encountered: