-
-
Notifications
You must be signed in to change notification settings - Fork 273
Description
I've been doing a lot of performance investigation into my company's use of Quill, and have found that onContentChanged is calling getSemanticHtml (see quill-editor.component.ts:418, here in textChangeHandler), which on a large document (20k words) can take tens of milliseconds, causing significant lag when typing.
I then found issue #1226, but unfortunately the debounced onContentChanged doesn't debounce deltas in the way I'd expect (you get the change delta since the last emission) but just drops changes, only emitting the last change, making properly tracking each change and parsing impossible. Here's some documentation of these two - in the second, I typed "Two friends", but only see changes for "o" and "s", where I paused.
Flamegraph Showing onContentChanged getHtml Calls |
Debounced onContentChanged Logs Showing Partial Deltas |
|---|---|
![]() |
![]() |
I wanted to see if:
- Do you have any idea why it looks like
getSemanticHtmlis getting called twice per keypress? The flamegraph doesn't make clear where the second call is coming from, but it's insidengx-quill - Would debouncing just HTML and text changes make sense? Quill itself doesn't seem to struggle with large documents, so I think just the HTML conversion is the big problem.
I'm happy to take a crack at opening a PR for any fixes, just want to make sure I have alignment and any guidance or tips!
Update: Just to show that QuillJS doesn't struggle with large docs, here's a screenshot showing the interaction times with 20,000 words:


