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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[All] Various Performance Issues #997

Open
Blquinn opened this issue Nov 6, 2022 · 2 comments · Fixed by #1964
Open

[All] Various Performance Issues #997

Blquinn opened this issue Nov 6, 2022 · 2 comments · Fixed by #1964

Comments

@Blquinn
Copy link
Contributor

Blquinn commented Nov 6, 2022

The performance of the editor begins to degrade when the document size gets reasonably large, especially when performing edits.

I ran some profiles with 500 paragraphs of text loaded. (from https://loremipsum.io/generator/?n=500&t=p)

It seems like the main issue is that the entire widget is re-drawn and re-laid-out on every edit. Meaning, every line of text is re-drawn on every frame, regardless of if it changed, or not. I think this should be avoidable. I also profiled https://github.com/superlistapp/super_editor and there was no jank when editing large documents, perhaps insight can be gained from there.

image

A couple of smaller issues:

Rasterization is slow on every frame, this seems to be due to the cursor blinking, but it only happens on larger documents, so I assume it's redrawing the whole document when the cursor blinks, or something like that.

image

Also, in RawEditorStateTextInputClientMixin calling "Document.toPlainText()" and diffing that against the editor text seems to be very slow for large documents.

@singerdmx
Copy link
Owner

image

I suspect this is one of the causes

@CatHood0
Copy link
Collaborator

CatHood0 commented Jun 4, 2023

I have the same problem. My app is for writing large docs. If i paste a text with 40000 characters or more, the editor starts to degrade for doing any operations (insert, or delete, or paste more text). Is there any way to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants