-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Thoughts on RichText & Performance #15033
Comments
Historically, my hesitations around delayed synchronization is the inevitable possibilities for race conditions. I think it would also be quite difficult to account for in end-to-end tests without introducing huge unreliability. These are solvable problems, but will be an ongoing maintenance burden I suspect. Synchronous updates provide a nice comfort in the certainty, and in ways force us to be mindful of the performance impact. That said, reflecting on AsyncMode in #13056, I think it was a huge success in leveraging lazy updates to dramatically improve overall feel for users.
Is this specifically referring to the distinction of the |
@aduth No, I'm talking about all the work that happens from the moment Perhaps we can do something like AsyncMode in #13056, but instead of just the page AND the selected block re-rendering (correct me if I'm wrong), re-render only the selected |
Hi! I think the suggestions for improving RichText performance could help with an issue that I'm seeing with a significant lag in resizing blocks while typing on mobile devices (see my comment here). I have seen this problem occur on both older and newer mobile devices. I spent a little bit of time looking into the cause, and it does seem to be the amount of work that's done in the |
I think since this issue was opened, we made a lot of progress to typing performance and performance in general. Maybe it's time to close this issue. |
While trying to make the native macOS color button work (found in the Touch Bar when using Gutenberg in Safari), I stumbled upon a performance issue: when sliding the control, the response time is so long that you can see the active color indicator slowly moving from one side to another. The problem is that Safari just emits an
input
event for every color in the range control you slide through, and Gutenberg cannot keep up with updating the store and rerendering everything.This could be solved by temporarily not calling the
onChange
prop for certain changes like color formatting, so the change still happens insideRichText
, but the store update is delayed. This made me wonder if we cannot simple do the same for any change, as it might benefit fast typing performance as well. I recall something similar being discussed a while ago, before #13056 came.The other option is to look into to again look into reducing the work done after
onChange
is called. I don't know where to even start with this. Cc @aduth @youknowriad.Why do we need rich text changes to be in the store immediately?
Other options:
There are two things that could improve:
input
event emission, where even a 100 ms buffer would help.For both to improve, it might be good to only call
onChange
whenever an undo level is added. This is currently done the second after the user stops typing. Would it be a bad thing to only sync the value at undo intervals? This might also remove some complexities in the store around persistence?I know something similar has been proposed before by @youknowriad.
The text was updated successfully, but these errors were encountered: