Description
Description
As some of you may know, our current way of getting the difference between two versions of the text is by taking the old version with the new version and going character by character, checking what was deleted and what was inserted (using the cursor position as a starting point).
However, this seems suboptimal to me. To be honest, many of us here, like myself, when using this editor, look for good performance and stability when doing anything with the editor. One of these things (and the most important) is inserting or deleting text.
Everyone here wants performance similar to Word, which can work without too many complications even with a document of more than 100k words.
This is possible, but we need to consider several aspects:
- How we render nodes: we need to find a new way to determine which elements are visible on the screen and render them. We can cache them and update the cache once they are displayed to the user (more or less like
ListView
does).- Status: being planned. Check this line, there is the place where we need to apply this fix.
Important
This point probably will be closed without fix it, since we are taking care about changing our implementation of TextInputClient
.
2. How we get the differences in the TextInputClient
implementation.
- Status: being fixed at Chore: improve getDiff perfomance for the editor #2517
- How we update the selection: We need to find a new way to update nodes internally when selecting nodes, and not require such aggressive rendering (currently, every small change causes
_buildChildren
inraw_editor_state
to be called, and this can be unnecessarily expensive when there are nodes that aren't actually visible on screen).- Status: being planned.
I'd love to be able to do all this myself, but honestly, I have my own projects and things to do, so making these changes will take some time (it will need a lot of testing too).
Anyone is welcome to contribute to this issue and improve the editor's performance, whether it's ideas or PRs.