You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Typing block editor has significant lag, particularly on Chrome MacOS #22822
Describe the bug
Typing in the block editor (most noticeably in the paragraph block) editor has a noticeable delay.
The lag increases the larger the post becomes.
On one machine, we are finding that typing a sentence of 10 words can take 30 seconds to render on screen.
Using Chrome's performance tool I've observed that keypress/keyup/keydown/input & their child events are taking a long time to run.
As an example, and comparing different machines (specs at bottom), a keypress event is taking
500-1200ms on a Macbook Pro
150ms on a Microsoft Surface
50ms on a desktop
250-450ms on the desktop with 4x slowdown enabled in chrome
Using the editor on the macbook Pro is truly painful - every 10 words taking 3-5 minutes to compose and completely breaking up the editing experice - while the desktop rendering is only a little bit jerky.
Neither is acceptable and while the MacBook is a bit old, I don't think it's fair to expect everyone to have gaming PCs to write some blog spots.
I appreciate this issue is similar to #6466 and #7680 - but both of those were closed in #7699, and the performance issues persist.
To reproduce
Steps to reproduce the behavior:
Add new post
Start Typing / adding content
Expected behavior
To have a smooth typing experience.
Screenshots
If applicable, add screenshots to help explain your problem.
Chrome performance Macbook:
Comparing classic block and paragraph block typing "The quick brown fox jumps over the lazy dog"
Editor version (please complete the following information):
Tested on clean version of WordPress 5.4.1 with no plugins and also on Wordpress 5.4.1 with only plugin being Gutenberg 8.2.1
Desktop (please complete the following information):
Machine 1: 2016 MacBook Pro / 2.9 GHz Intel i5 / 8GB RAM / MacOS Catalina 10.15.4
Machine 2: Microsoft Surface 2.5 GHz Intel i5 / 8GB Ram / Windows 10
Machine 3: PC Desktop / 3.3 GhZ Intel i0 / 32GB Ram / Windows 10
Reacted by Melroy van den Berg, Zoltan Kundi, Artem Nechunaev and Jeff
On one machine, we are finding that typing a sentence of 10 words can take 30 seconds to render on screen.
@jamescl That seems very unusual. All of the machines you mention seem relatively modern and I wouldn't expect that level of performance. I often test in virtual machines with much lower specs and haven't had those kind of issues 🤔
hi @youknowriad - as mentioned, the test results shown are running WordPress 5.4.1 with no plugins and also on Wordpress 5.4.1 with only plugin being Gutenberg 8.2.1 and getting similar results. Prod with plugins and custom themes is worse, but can't pin it down to a particular plugin.
Have also tested on a brand new install with 1 post, 1 user, WordPress 5.4.1 and no plugins activated (akismet and hello dolly installed, but not active) running twentytqwenty theme. Keypress event on that site, using desktop is 30ms
As a comparison, a keypress when filling in this form on github takes 3.49ms - nearly a 10x performance difference.
Using the CPU throttling function in Chrome Dev Tools leads to dramatic performance declines, which might explain differences in testing/virtual environments vs real world usage when users have multiple tabs/applications open while putting together posts.
I'm pretty sure that's some variable here we're missing. We do perform performance checks on each Gutenberg release on a very large post (See the results at the bottom of these posts https://make.wordpress.org/core/tag/gutenberg-new/ ) and even for a very large post, I have a keypress event average to something like 30ms (macbook pro).
These benchmarks are generated by running npm run test-performance on a Gutenberg prod build.
I also haven’t been able to reproduce this on a MacBook Pro + Chrome. I also get about 30ms on average. Would it be possible to share example content, or does it start even with a new post and one paragraph?
Based on the comments above, I've tried to re-create on a local install, and seeing mush faster results. Made me think I was going mad - but have attempted to try and figure out what's going on.
As an observation, the behaviour I'm seeing occurs when the CPU utilisation within the Chrome Task hits 100%.
So when typing a sentence under ideal conditions, CPU doesn't seem to peak past 20%, the typing is visually smooth and the profile in chrome performance looks like this:
If we turn on 4x CPU throttling in devtools, the same action sees CPU usage hitting 100%, the typing becomes laggy and the performance profile looks like this
Appreciate that the CPU throttle isn't real life, so then tried to see what might be the culprit in my environment, and most notably found that in my initial "clean install" I had 'SCRIPT_DEBUG' set to true in wp-config, and turning that off improved key-press events from around 40ms to 20ms
Which didn't explain the behaviour I'm seeing in my prod site, as that setting was off. I've tried unit testing plugins and my theme, and not seeing a noticeable difference from any in particular (although in aggregate they may well be having an impact).
What I can see having an impact on lag is:
Running incognito seems to be faster - presumably because of the Chrome extensions I'm running.
Having a preview tab open had a impact - presumably because chrome uses the same task to run both tabs.
Putting stress in general on the machine in question (e.g. having lots of tabs open with video playing)
More blocks and complex blocks (e.g. youtube embed inside a column) seems to cause higher CPU usage, although only intermittently.
Chrome's performance monitor shows that the CPU usage is from react.js
I think it's reasonable to conclude, therefore, that if you have some form of CPU constraint (either real or artificial) causes a visual lag on keypress events from Gutenberg's use of react.js
I can keep digging to find more specifics - but to be honest I'm not that familiar with js and even less so with react.... so the below might be a red herring, but here goes:
Using react devtools (and by necessity script debug on) - each keypress seems to result in render events on the block property pane, as well as the top toolbar. Screencap is with the "Highlight updates when components render." option selected in React DevTools for Firefox
Warning: React does not recognize the isSelected prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase isselected instead. If you accidentally passed it from a parent component, remove it from the DOM element.
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
My key questions are
Does the above help identify areas to improve performance?
Is there some other way I could identify where a 3rd party plugin/theme/browser extension could be causing issues that could be raised with them?
There are several performance improvements planned for 6.2. That said, performance can always be improved, and each release will strive to do so. I have updated the issue labels and will keep this issue open until 6.2 is released. If anyone experiences additional performance issues when using the latest version of Gutenberg, please add them here or create separate issues. Thanks!
I used large-post.html as content, which is also used in the performance test. In my environment, I see a noticeable drop in performance when the Document Overview panel is open. Enabling the fixed toolbar had no effect.
Open the post editor.
Type some more letters in a paragraph block and check the response.
Switch to the code editor and paste the entire contents of large-post.html.
Get out of the code editor. It may take perhaps 10 seconds or so for the content to appear.
Type text. In my environment, I could see a significant response drop here.
Hide the Document Overview panel and type the text again. In my environment, performance seems much improved.
I just wanted to check if you got a chance to test typing performance improvements that shipped with the latest versions of the Gutenberg plugin and are coming in core with the next major release.
I can no longer reproduce without throttling (I'm using the same machine as before and the same large post as before), so things are definitely better!
However, with 4x CPU throttling, it's still easy to reproduce, so I'd expect there are still opportunities for improvement.
Activity
talldan commentedon Jun 3, 2020
@jamescl That seems very unusual. All of the machines you mention seem relatively modern and I wouldn't expect that level of performance. I often test in virtual machines with much lower specs and haven't had those kind of issues 🤔
youknowriad commentedon Jun 4, 2020
What plugins do you have? did you try disabling the plugins to see if it has any impact?
jamescl commentedon Jun 4, 2020
hi @youknowriad - as mentioned, the test results shown are running WordPress 5.4.1 with no plugins and also on Wordpress 5.4.1 with only plugin being Gutenberg 8.2.1 and getting similar results. Prod with plugins and custom themes is worse, but can't pin it down to a particular plugin.
Have also tested on a brand new install with 1 post, 1 user, WordPress 5.4.1 and no plugins activated (akismet and hello dolly installed, but not active) running twentytqwenty theme. Keypress event on that site, using desktop is 30ms
As a comparison, a keypress when filling in this form on github takes 3.49ms - nearly a 10x performance difference.
Using the CPU throttling function in Chrome Dev Tools leads to dramatic performance declines, which might explain differences in testing/virtual environments vs real world usage when users have multiple tabs/applications open while putting together posts.
youknowriad commentedon Jun 4, 2020
I'm pretty sure that's some variable here we're missing. We do perform performance checks on each Gutenberg release on a very large post (See the results at the bottom of these posts https://make.wordpress.org/core/tag/gutenberg-new/ ) and even for a very large post, I have a keypress event average to something like 30ms (macbook pro).
These benchmarks are generated by running
npm run test-performanceon a Gutenberg prod build.youknowriad commentedon Jun 5, 2020
How this got closed by the #22577 I don't understand? Github bug maybe
talldan commentedon Jun 6, 2020
@youknowriad Looks like it was linked in the right-hand column on that PR, not sure how, maybe the wrong issue was linked.
ellatrix commentedon Jun 16, 2020
I also haven’t been able to reproduce this on a MacBook Pro + Chrome. I also get about 30ms on average. Would it be possible to share example content, or does it start even with a new post and one paragraph?
jamescl commentedon Jun 18, 2020
Based on the comments above, I've tried to re-create on a local install, and seeing mush faster results. Made me think I was going mad - but have attempted to try and figure out what's going on.
As an observation, the behaviour I'm seeing occurs when the CPU utilisation within the Chrome Task hits 100%.

So when typing a sentence under ideal conditions, CPU doesn't seem to peak past 20%, the typing is visually smooth and the profile in chrome performance looks like this:
If we turn on 4x CPU throttling in devtools, the same action sees CPU usage hitting 100%, the typing becomes laggy and the performance profile looks like this

Appreciate that the CPU throttle isn't real life, so then tried to see what might be the culprit in my environment, and most notably found that in my initial "clean install" I had 'SCRIPT_DEBUG' set to true in wp-config, and turning that off improved key-press events from around 40ms to 20ms
Which didn't explain the behaviour I'm seeing in my prod site, as that setting was off. I've tried unit testing plugins and my theme, and not seeing a noticeable difference from any in particular (although in aggregate they may well be having an impact).
What I can see having an impact on lag is:
Chrome's performance monitor shows that the CPU usage is from react.js
I think it's reasonable to conclude, therefore, that if you have some form of CPU constraint (either real or artificial) causes a visual lag on keypress events from Gutenberg's use of react.js
I can keep digging to find more specifics - but to be honest I'm not that familiar with js and even less so with react.... so the below might be a red herring, but here goes:
Using react devtools (and by necessity script debug on) - each keypress seems to result in render events on the block property pane, as well as the top toolbar. Screencap is with the "Highlight updates when components render." option selected in React DevTools for Firefox
I'm also seeing errors in the console in Firefox:
console errors.txt
isSelectedprop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercaseisselectedinstead. If you accidentally passed it from a parent component, remove it from the DOM element.My key questions are
35 remaining items
ndiego commentedon Jan 24, 2023
There are several performance improvements planned for 6.2. That said, performance can always be improved, and each release will strive to do so. I have updated the issue labels and will keep this issue open until 6.2 is released. If anyone experiences additional performance issues when using the latest version of Gutenberg, please add them here or create separate issues. Thanks!
G33kNoob commentedon Feb 19, 2023
any update on this issue? cause I feel uncomfortable, seem another tool faster at typing
ellatrix commentedon Feb 21, 2023
Worth noting that with the fixed toolbar option the performance will be worse (same with inspector controls).
Mamaduka commentedon Jun 7, 2023
@ellatrix, @mcsf, there's a new report with reproduction steps - #51210.
t-hamano commentedon Jun 12, 2023
I will also describe another reproduction step.
I used large-post.html as content, which is also used in the performance test. In my environment, I see a noticeable drop in performance when the Document Overview panel is open. Enabling the fixed toolbar had no effect.
e4943e651c6c008143bf3df206a08b54.mp4
Environment info
Mamaduka commentedon Jun 12, 2023
Thank you, @t-hamano!
Do you get the same results when running tests on WP 6.2 without the Gutenberg plugin active?
t-hamano commentedon Jun 12, 2023
@Mamaduka
Yes 😅
t-hamano commentedon Jun 13, 2023
Measurement Report
I used the Profiler of the Chrome extension React Developer Tools to check the rendering status of each component.
Measurement Steps
The above procedure was tested with the List View and Outline tabs open respectively.
Environment info
Measurement Results
The JSON file attached to each result should be able to be imported in Chrome's Profiler page for more information.
When the List View panel is opened
I don't know much about this tool, but it looks like the
ListViewBranchis rendered many times.Screenshot
profiling-data-with-list-view.zip
When the Outline panel is opened
There does not appear to be a large number of renderings, but the calculation process for word and character counts might be heavy.
Screenshot
profiling-data-with-outline.zip
t-hamano commentedon Jun 19, 2023
I checked again with the latest trunk and it appears that performance has improved somewhat in my environment. Maybe thanks to #51518 🤔
(Compare with the video of this comment)
5723a91db63162a30285d451f5526126.mp4
tyxla commentedon Sep 26, 2023
I'm able to reproduce with a large post and when typing swiftly.
Trying out one potential improvement in #54819.
Mamaduka commentedon Jan 10, 2024
Hey, everyone 👋
I just wanted to check if you got a chance to test typing performance improvements that shipped with the latest versions of the Gutenberg plugin and are coming in core with the next major release.
tyxla commentedon Jan 10, 2024
I can no longer reproduce without throttling (I'm using the same machine as before and the same large post as before), so things are definitely better!
However, with 4x CPU throttling, it's still easy to reproduce, so I'd expect there are still opportunities for improvement.
Mamaduka commentedon May 1, 2025
I'm going to close this as resolved. Typing performance has improved five times in recent releases, and we consistently monitor it.