Describe the bug
As the developer @youknowriad of GBerg asked me, I will now report a new bug: the editor is still slow after the official 4.3 update. I have the feeling that it has become even slower. Old bug that should be solved: #10418
In this article I have already explained what the problem is. Here again the roughest overview:
If you insert an article with a lot of words, headings and blocks, the following happens: the GBerg becomes extremely slow. You can hardly write. It may be due to my internet connection (see here), but I wonder why I can write in all other editors while I'm still sneaking around with GBerg. By the way, this bug has also been noticed by a member of Automatic (see here)
Old Editor:
That's clearly not the same content. Since I can't take the blocks one at a time. I did the test with over 7000 words and the write flow is much better and faster.
New Editor:
http://recordit.co/F7R4jUi7a6 (Please watch the console where you can see that I am writing.)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A smooth write flow like the old editor. Without interruptions.
Desktop (please complete the following information):
Additional context
Related: #11770
I can reproduce that, I tested it with the by far longest article from my blog. Converting it from classic block to blocks takes a while but works, but typing has a delay from more than a second – much better (almost without delay on typing) in the old editor. My internet speed is 36.2 Mbit/s download and 8.96 Mbit/s upload. Testing with the content of @SchneiderSam works better. If it helps, here is the content of the post in HTML format (so the conversion to blocks can be tested, too): https://gist.github.com/florianbrinkmann/4e9e4d23eaefb8b23484badddd848196
So if I insert @florianbrinkmann content, nothing works for me anymore. That's pretty bad, I can't do anything here anymore. GBerg loads and loads... write with delay and Wordpress hangs up.
Loading an article on the editor page containing the content provided by @florianbrinkmann lead to a blank screen for 44 seconds and afterwards to another 56 seconds of FOIT (using Safari 12.0.1)
...and that test took place in a local dev environment by the way.
Can confirm 4.3 still takes about a minute to load:
Words: 3451
Headings: 29
Paragraphs: 34
Blocks: 218
The post is a list of column blocks with images and paragraphs in each columns.
Once loaded typing is very delayed/laggy.
4.3: yep, we're also seeing editor massively slow down on long posts. Column blocks seem to be involved.
One additional piece of information which could be useful are any plugins active on a site, particularly those which may have recently updated to add compatibility with Gutenberg†.
_†The thought here being to eliminate a possibility where a plugin is implemented in such a way that it could be affecting performance of the editor._
For mine the only plugin directly integrated with Gutenberg is Yoast SEO, but deactivating it makes no noticeable difference in load time or response time typing.
Tested with 5.0-beta4-43896 and no plugins. Same result. Especially with the content of florian :-)
There are a number of recent pull requests (not yet included in a plugin release) which seek to address some performance degradations related to interface updates in response to block updates (e.g. writing in a paragraph):
One additional culprit I've noticed is that while specifically updating blocks within a nested context (e.g. Columns), there is some wasteful / unnecessary updating which occurs to the block's ancestors.
_(The above GIF uses React DevTools "Highlight Updates" feature)_
Are there any benchmarks for before and after these PRs?
@aduth and @youknowriad - Tested with GB 4.4 and: it is still slow. Please continue, it doesn't make sense for me as an author to install GB if I can't write properly. I hope this will be fixed before Wordpress 5.0.
Do I expect too much?
Do I expect too much?
Certainly not. I can confirm, on 4.4.0 my real-world content sample is still unusably slow to edit.
Hopefully the other related PR-s can do something, and we're not dealing with a massive architecture problem here.
There are a number of recent pull requests (not yet included in a plugin release) which seek to address some performance degradations related to interface updates in response to block updates (e.g. writing in a paragraph):
- #11845
- #11844
- #11843
- #11842
- #11841
All mentioned PRs were fixed with 4.4 - that's why I wrote again. That worries me:
https://github.com/WordPress/gutenberg/pull/11811#issue-230464225
But well I don't want to depremiate anyone here, but I just have astomach ache: so far I was a huge fan of GB, but it's no fun.
Work toward improved performance continues. Hence why this issue remains open.
You may be interested in observing the Performance label to stay up with the latest: https://github.com/WordPress/gutenberg/pulls?utf8=%E2%9C%93&q=is%3Apr+label%3APerformance+
Okay, thanks for working so hard. Please keep up the good work. As I said, the worry comes only because we are not two weeks before the release.
Thank you!!!
retested with gutenberg 4.4, the content is the long article by @florianbrinkmann again and gutenberg is the only plugin installed on 4.9.8 running on local by flywheel. 35 seconds white screen and another 33 seconds FOIT.
Hey everyone! After some investigative work on this, it seems to me that a big part of the problem with typing becoming slow as the number of blocks grows is the way the state tree is organised.
Block information is stored in state.editor.present.blocks
, with the information for each individual block under state.editor.present.blocks.byClientId
. There's also state.editor.present.blocks.order
, which keeps track of block order in the document.
blocks: {
byClientId: { [ clientId ] : { name, attributes, isValid ... } },
order: [ ... ]
}
When a user types in the current paragraph block, this modifies state.editor.present.blocks.byClientId[id].attributes.content
. This means that any selector that depends on state.editor.present.blocks
or state.editor.present.blocks.byClientId
will be invalidated on every keystroke, making it an expensive branch of the tree to depend on.
Now, there are some selectors that are able to get around this by depending on state.editor.present.blocks.order
instead. However, the only real information there is the block ID, so for selectors like getGlobalBlockCount
that take an optional name to filter by, it's not a valid option. This means that getGlobalBlockCount
currently depends on state.editor.present.blocks.byClientId
and thus gets invalidated on every keystroke. There are several other selectors in the same situation.
The solution I'm looking into, at @youknowriad's suggestion, is removing attributes from their current location in the tree structure, and placing them instead in state.editor.present.blocks.attributesByClientId
. This would split the tree structure into a cheap branch that only gets updated when blocks get added/removed, or when the block type changes for a block (byClientId
); and an expensive branch that gets updated on every keystroke (attributesByClientId
).
blocks: {
byClientId: { [ clientId ] : { name, isValid, ... } }, // Cheap
attributesByClientId: { [ clientId ] : attributes }, // Expensive
order: [ ... ]
}
Selectors could then be modified to depend on byClientId
, attributesByClientId
, or both, depending on what they need.
This should reduce the amount of unnecessary work going on, but it's hard to estimate exactly what the performance gains will be. There is significant time being spent on Redux with every keystroke at the moment, though, so it does seem that this could lead somewhere.
That sounds positive. Is there already a marching direction? Will that be fixed before 5.0?
I'm thinking of the comment by matt:
Some good measures of success for Gutenberg:
....
Can they create things they weren’t able to create before?
I find that an interesting statement. That's definitely something Gutenberg can't do and has considerable flaws. For authors and online marketers this is a mustiarte, otherwise I can completely do without GB.
Tested the same post with the RC. 27 seconds white screen and 7 seconds FOIT. Still far away from an acceptable performance. :/ ... and on a side note so far i only tried loading the post with gutenberg now the first time tried to type something in it. from typing a sentence of 40 characters until that sentence showed up at once in the block i typed it in it took 19 seconds.
Hope this gets fixed soon. We are novel writers and translators. Our editors are sick of the slow speed typing of GB that they copy it into Word, edit and then put it back. Unfortunately we switched to GB on our free plan sites to maintain compatibility...
We don't have a crazy amount of paragraphs in each post, perhaps about 60-80 and 2 separator blocks. About 7-8 pages worth of content. Still typing or deletion happens with a perceptible delay.
All of us have 15-50Mbps connections.
@brazenvoid Thanks for sharing. This has to be fixed in any case. I can't work like this.
No label bug?
Is this no bug?
I have tested with Gutenberg 4.5.1, WordPress 4.9.8 (no other plugins). With the Text of @florianbrinkmann, I inserted the HTML into classic editor (text view), saved, converted it to Gutenberg Blocks. The conversion had a duration of 12 seconds. Now when I type in a block, every letter needs more than 1 second.
--- nothing else installed than beta tester plugin ---
New post, block classic -> edit as HTML -> insert copied HTML of Florian, publish. Converts to blocks (12 second), type in a block, every single letter needs more than 1 second.
I don't know, if this has any relevance:
MySQL Version 5.7.19
PHP Version 7.2.11-2+0~20181015120510.9+jessie~1.gbp8105e0
PHP max_execution_time 360
Tested PHP Max Execution Time 260 secs
Reported PHP Memory Limit 2048M (local) / 2048M (master)
Tested PHP Memory Limit 1716 MB
PHP Maximum File Upload Size (server-reported) 50 MB
Post Max Size: 50M
Max Input Vars: 1000
My internet speed is 150 Mbit/s download and 10 Mbit/s upload
I too have tried a few of my longer articles 2500+ words with 10 to 15 images, one or more tables. Converting to Gutenberg takes more than 15 seconds for each article. Typing later is slow for shortest of the articles 2550 words, and unusable for an article with 4121 words (more than one second for each letter), Chrome (and same in Firefox, both latest versions), memory usage climbs rapidly, and CPU usage goes close to 50%. All this is done with clean WP 5.0 RC install, default theme and no other plugins, on Lenovo laptop with i5 8gen CPU and 8GB of RAM. I wasn't going into details what the Chrome console shows, but this is unusable.
This has to be marked as a bug, and it has to be resolved before you can even think that Gutenberg editor is anywhere close to usable. If it remains in the 5.0, you can use Gutenberg with texts with up to 1000 and a moderate number of blocks. I noticed slowness with any text I tried that gets to be a bit longer.
I doubt that any developer working on it has tested Gutenberg in the past year with text longer than the demo text. I know that 3000+ words texts are not common, but this will affect not only long text but complex layouts with nested blocks. I can't even imagine what kind of chaos will start when a third party blocks are added. Or imagine, if you try to do some casual editing on some older laptop or tablet even, that will be very frustrating.
I'm not sure why everybody is posting their internet speeds, but posting your browser information might provide more insights into the issue at hand. The editor runs in your browser. Knowing why your browser might be slowing down would be more useful.
I’m using Firefox Nightly, currently version 65.0a1 (2018-11-25) (64-Bit) (on Windows 10).
I'm not sure why everybody is posting their internet speeds
People don't understand the tech details here always, so probably posting it just in case from a general "slow" perspective.
But regardless, I think the development team already knows the underlying architectural issue here. Hopefully it'll work out.
It should also be noted that the entire editor is slow, not just RichText elements. Updating the permalink slug (in the document settings) or anything else that takes input is slow.
There are 3 areas of improvement as far as I see:
@spencerfinnell The PR #12312 should have an impact on both the second and third points.
I tested it today with the content provided by @SchneiderSam and the problem persist for me. I tested it with Firefox in the current RC as well as with the nightly build plugin and wp 4.9.8. I also tested it with Chrome. There it lags a bit as well, but not as bad as with Firefox.
Here is a screencast with my xp: https://www.youtube.com/watch?v=yIV6REWM5tE
Ubuntu 14.04
Browser Information:
Name Firefox
Version 63.0.3
Build-ID 20181116161301
User-Agent Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0
Operating System Linux 4.4.0-139-generic
probably not too much new info as i see, the discussion on this topic has quite evolved, wanted to leave it anyway.
This happens even without inserting articles with a lot of words. The current release of Gutenberg just hangs horribly all over the place no matter what you do. You can restart your browser and expect it to work smoothly for about half an hour.
I have 16 GB of RAM. I have a 1080 TI. I have an i7 Haswell processor. I should not EVER be experiencing ANY LAG WHATSOEVER in a TEXT EDITOR.
Retested RC2 with Safari 12.0.1 with Local by Flywheel and Florian Brinkmanns sample article (no plugins installed except wordpress beta tester plugin and the classic editor plugin but the latter was deactivated during the first test).
White Screen for 68 seconds
FOIT for another 35 seconds
after reactivating the classic editor and reloading the article:
No content in the body meta box 12 seconds
FOIT for another 2 seconds
Feels things remained bad or got even worse loading the article with gutenberg.
Tested with my content + 4.6 and the performance is unchanged. The way it looks, it's not solved with 5.0. Too bad, but ok you're working on it. Thank you very much!
Retested with RC3 in Safari 12.0.1 with Local by Flywheel and Florian Brinkmanns sample article (no plugins installed except wordpress beta tester plugin and the classic editor plugin but the latter was deactivated during the first test).
White Screen for 41 seconds
FOIT for 52 seconds
In context with the new release date in two days anywhere near production ready performance wise.
In context with the new release date in two days anywhere near production ready performance wise.
Yeah. I'm not sure what exactly @m means in his article https://ma.tt/2018/11/a-gutenberg-faq/ where he writes:
We have had a stable RC1, which stands for first release candidate, and about to do our second one. There is only currently one known blocker and it’s cosmetic.
Makes me, for one, go :thinking:
As long as this point #12312 is not solved, I will wait with the update. That just doesn't make sense to me.
@sgomes and co: please keep up the good work. I can imagine that you get pressure from everywhere. Thanks for working on it! Unfortunately I can only help with my words! You're doing a great job!!!
There are a number of additional performance optimizations which have been merged or approved for merge but not yet included in a release, as they missed the deadline for RC code freeze. These are slated to be included in a 5.0.1 patch release to follow soon after 5.0.0 .
@aduth great. You are great. It's really nice to see that you consider the wishes of the Cummunity and take them seriously. Please don't let the many negative comments dismotivate you. We as a community also have the responsibility to support you developers. That's a bit too short at the moment and I have to get my own nose into it.
Therefore: all thumbs up!!!! You are great!
Still having these very slow load issues as well. Have been looking into solutions for the past week. I use most up to date version: Gutenberg Version 4.6.1, and Wordpress 4.9.8.
I created my first 20 or so posts with Gutenberg editor which was great with the exception of slow loads on longer posts which is most of my posts. They are generally long with many blocks and images. I then downloaded YoastSEO and it bugged down my site completely. My site was already running slow and with Troubleshoot mode I realized it was Gutenberg and then made worse combined with YoastSEO.
Now I have to use Classic Editor and a lot of my links no longer are embedded with nice preview that 'Gutenberg has and spacing is all off from when I used the nice Gutenberg platform.
So at this point, I either
Any insight here would be greatly appreciated on how I can best proceed. @aduth @SchneiderSam
Didn't really get anywhere with my thread here:
https://github.com/WordPress/gutenberg/issues/12508#issuecomment-443919417
@aduth have you tested a build with those patches applied against loading a post with the content of the Florian Brinkmann article ( https://github.com/WordPress/gutenberg/issues/11782#issuecomment-438213916 )? Is it on par with those of TinyMCE now? And is typing and editing within that article possible in real time now? And out of curiosity why those patches haven't made it into 5.0?
Still having these very slow load issues as well. Have been looking into solutions for the past week. I use most up to date version: Gutenberg Version 4.6.1, and Wordpress 4.9.8.
I created my first 20 or so posts with Gutenberg editor which was great with the exception of slow loads on longer posts which is most of my posts. They are generally long with many blocks and images. I then downloaded YoastSEO and it bugged down my site completely. My site was already running slow and with Troubleshoot mode I realized it was Gutenberg and then made worse combined with YoastSEO.
Now I have to use Classic Editor and a lot of my links no longer are embedded with nice preview that 'Gutenberg has and spacing is all off from when I used the nice Gutenberg platform.
So at this point, I either
- Use Gutenberg and deal with slow speed hoping for future update and then delete Yoast and figure out other solution for seo and meta descriptions.
- Or figure out better Editor that mimics Gutenberg without hampering load speed.
Any insight here would be greatly appreciated on how I can best proceed. @aduth @SchneiderSam
Didn't really get anywhere with my thread here:
#12508 (comment)
Hi,
so I see the developers are working on it. Take a look at this article. With the next update 4.7 and 4.8 this should hopefully be solved. I completely understand you. At the moment I'm only writing short articles because it's no fun. The only thing I'm doing right now is to be patient and motivate the developers with feedback.
By the way: I'm not a developer, I'm just a small author like you ;-)
Marking high priority and assigning to the next minor release.
The work listed by @aduth in https://github.com/WordPress/gutenberg/issues/11782#issuecomment-444144278 improves typing performance by more than 340% and will be shipped as part of WordPress 5.0.1.
It's unclear what action needs to be taken for this issue to be considered resolved. Performance work is never really "finished". For now, I'm moving this issue to 5.0.2 so that we can keep track of further performance improvements here.
@noisysocks that is easy to assess. Use the Florian Brinkmann article. As soon as the loading of the article with caching disabled is en par or faster than with TinyMCE and the typing is without lagging and hickups in real time en par with TinyMCE then I would consider the issue resolved.
Testing with 5.0 for the past few days, and I don't have any performance issues. I tested with the text that has 300+ blocks, 15000+ words, 50+ images, there are no noticeable delays with typing, or using the editor. But, browser RAM usage grows close to 2GB, with CPU using about 15%, and considering how much content editor handles, it is not that big of an issue. Tested on Lenovo laptop with 2 Core i5 CPU (with Hyperthreading, Gen7) and 8GB RAM. The issues I had with Beta and RC1 are resolved for me.
Testing with 5.0 for the past few days, and I don't have any performance issues.
I can't confirm that. 5.0 is slow. Wait for 5.0.1
I can't confirm that. 5.0 is slow. Wait for 5.0.1
I believe that there are external influences that cause for some users to work fine, and for some to have performance issues, and it is not very surprising at all, considering that it is mostly JavaScript and React powering it. When I visit any Facebook page, my laptop feels so slow, like it is 10 years old machine. And I am surprised that Gutenberg in 5.0 works fine for me, but I am not surprised that it is broken for so many other users.
I really hope that Gutenberg performance issues can be solved for all users, but at this point, I am not so sure in that. If the system can be broken by the influence of an extension or two, few plugins maybe, it is fundamentally bad design at fault.
Still, I have not updated my websites yet, I have also opted to wait for 5.0.1.
No performance testing should be done without the Yoast plugin installed and Grammarly browser addon enabled as that is a normal use case scenario. If it performs perfectly fine without either of them, but the second you install one of them it becomes utterly unworkable, then the whole thing is unworkable.
And honestly it's not believable to me that anyone is having good performance on any setup even without these installed. I think your standards are just incredibly low. I almost guarantee that if I tried to type on your computer with Gutenberg I would be utterly dismayed.
Gutenberg doesn't work at all for text editing on my i3 laptop, my i5 iMac, or my i7/1080 Ti desktop, with or without plugins. Without plugins, it's unbearably bad performance, with them, it's completely useless, we're talking one frame per 5 seconds here.
What I really don't understand is, why is ANY lag being treated as acceptable?? That doesn't happen when you simply create a
I use Grammarly, but I never use the Yoast plugin. So far, Grammarly has not caused any issues for me. And, my standards are far from low, far from it. I have been testing Gutenberg from the very first version it was released and written about it several times this year with long lists of complaints about it.
I am genuinely surprised that 5.0 works for me, but I am not surprised that it doesn't work for other users. Using JavaScript and React as a centrepiece of the editor is a bad idea, and I have been saying that from the start, but here we are.
One hour ago, I updated a client website to 5.0 (he insisted), he used Yoast Pro plugin and for the most part, it works OK. But, as soon as I tried to convert one of the longer posts he has (some tutorial with around 4000 words), editor breaks even during the conversion processes. After a few tries, it manages to finish the conversion, but the editing is very slow and barely usable. Once the Yoast plugin is disabled, it works as expected. I am not sure who is to blame, most likely both Gutenberg and Yoast (from what I understand on how Yoast works, it has to hook itself into every piece of content in the editor), regardless, the more plugins start popping out for Gutenberg, things can go only worse.
Any lag in the editor is unacceptable, and I am not here to defend Gutenberg. For the sake of conversation and debugging the issue, I reported problems I had before and what happened after. I really hope 5.0.1 will do the trick to fix it for everyone.
As mentioned by @noisysocks in https://github.com/WordPress/gutenberg/issues/11782#issuecomment-445691324, there are a number of pending performance changes scheduled for 5.0.1. These are now also available for early testing in the Gutenberg v4.7.0-rc.1 plugin, available for download (direct download).
Regarding Yoast specifically, this also includes #12161 and #12741 (#12186), which address a critical performance degradation specific to the @wordpress/annotations
package that is not presently used in a stock installation, but leveraged by Yoast for their readability analysis.
I just installed the release candidate. The degree to which it improves performance cannot possibly be overstated. I really didn't think an improvement like this would be forthcoming. I'm even more so in utter disbelief that the final release wasn't postponed for these fixes, but I am also in a state of extreme relief that I was wrong about the flaws being fundamental and unfixable.
Many, many thanks to those who are responsible for that update.
I also installed the rc.... WOW! Great job. I have a 3550 words blog post I am currently working on. I have Yoast installed and active. Typing with the new 4.7.0-rc1 goes great, but if you use the backspace it feels there is a slightly longer delay before the character is removed. Will do more testing the upcoming days,
I can't confirm that. Both with mine, and with the contents of florianbrinkmann simply only slowly. Backend is even frozen.
Test with the neww RC 4.7 RC-1. Please check this: http://recordit.co/k5qszezoFQ
I am so concerned about this topic that I have now carried out further tests. I really want to help optimize GB and therefore want to publish my tests:
First I tested a completely new WP 5.0 version + 4.7.0-rc-1.
Then I tested an existing WP 5.0 version + 4.7.0-rc-1 + 27 plugins.
Up to here the question arises to me: why can I write quite well with a fresh installation, but not with my attached website. So it must be the plugins.
I deactivated one plugin after the other. My result: wpSEO is the problem.
_Setup: WP 5.0 version + 4.7.0-rc-1 + 26 activated plugin + wpSEO deactivated._
But: if I install a fresh WP 5.0 version + 4.7.0-rc-1 + wpSEO, then it works again and I can write normally. And there I come to my limits: how can that be?
If I activate everything except wpSEO during the fresh installation: wonderful. The Problem is wpSEO.
If I only activate a fresh WP 5.0 version + 4.7.0-rc-1 + wpSEO: wonderful
The bottom line is: SEO plugins are responsible for poor performance. But also not always. I will test and report on other SEO plugins like the SEO Framework and YOAST. GB still has a problem with the performance, especially with the content of florianbrinkmann.
_edit: SEO Framework works fine! Even with this setup: WP 5.0 version + 4.7.0-rc-1 + 26 activated plugin + SEO Framework. Whereby wpSEO must be deactivated._
Nice diagnosis @SchneiderSam . I'd not go so far to say that it broadly affects SEO plugins; it's likely more nuanced to a plugin's specific integration with Gutenberg. SEO plugins may be more inclined to take advantage of the "annotations" module, but since this should be largely improved by 4.7.0, it may be something else if it is still problematic when tested with the release candidate.
Unfortunately, wpSEO does not make their code (at least their JavaScript) freely available for further investigation. That said, in their minified code, I did spot this bit of problematic code:
wp.data.subscribe(function(){var a={postContent:wp.data.select("core/editor").getEditedPostContent()};wpseo_inspect(a)})
This is likely to be very non-performant in that it will force every block to compute its saved result on any change which occurs in the editor. It would be better for them to (a) operate on the block objects themselves and (b) only if the blocks actually change. I'll make a note to submit a support request through their website directing them to this issue.
_Edit (2018-12-12): Their support folks have responded with a note that a new version of the plugin is planned to be released soon._
4.7 is a great improvement -- but I'd love to see this issue remain open as I still think it's not quite a 1:1 of the classic editor.
Great work! It went from basically unusable to very responsive.
@SchneiderSam if an SEO plugin slows down the editing experience that's mostly because there are some underlying issues, that are luckily already scoped. 4.7 is truly a GREAT improvement in performance already.
Tested the Florian Brinkmann article with WordPress 5.0.1 and Gutenberg 4.7 with Local from Flywheel again. No plugins no nothing installed aside. Just fired up a fresh container and tried to load the article in Safari 12.0.2
White screen: 41 seconds loading the article
FOIT : 0 seconds (Noto wasn't used that might be the reason that there is no FOIT)
Scrolling is slow and typing still has lags. The issue isn't anywhere near being fixed. Still not a usable product. And i have to close the editor now again cuz my ears are aching from the noise the notebook fans are making which are steadily running on full speed after the post started loading.
Update:
I had to rerun the test. I noticed i forgot to keep my devtools open to take care that no caches are being used. Now the results are way worse to the previous test and the FOIT is back in.
White screen: 86 seconds loading the article
FOIT : 59 seconds
Edit (2018-12-12): Their support folks have responded with a note that a new version of the plugin is planned to be released soon.
So wpSEO 4.5.3 just tested with GB 4.7 (my content): sooooo much faster. That's how it has to be. Many thanks to all of you!
Also tested the now famous "The Florian Brinkmann article". Gave up after 15 seconds of loading time. No editor should load more than..let's say 5 seconds? More load time?
That is not viable for an editing experience!
FF 64, Ubuntu
I am also experiencing this problem with articles that over 2,000 words or longer, testing on both local installs on my Macbook with Mojave initially starting my testing several months ago with the Gutenberg plugin and then most recently these past few days on sites running WP 5.0.1.
Here are the specific things I notice when it begins to lag:
Typing is delayed by at least 5-7 keystrokes
It is painful to attempt to scroll from the top of the post to the bottom of the editor
There is a delay when attempting to add new blocks
There is a delay when attempting to change paragraph formatting to a list or heading
Saving and exiting the post does not fix the lag time - it also takes a noticeably longer amount of time for the post to reload from the Posts screen
My current theory is the more time spent in the editor, the larger the post size, and the higher number of post revisions the slower it gets.
I am not sure if this is an accurate theory, but in my testing I find that if you just copy/paste 7,000 words of text in markdown with headings, links, lists, etc. you may be able to save and publish with no problem. Safari is noticeably faster than Chrome, but both are often still workable.
However, once you paste your article and then spend more than 20 minutes in the editor formatting text or photos, you will start seeing things slow down more and more.
This problem is made worse if you happen to have other distractions that take your attention away from the editor, such as having children, parents, pets, housemates, a phone, instant messages, a spouse, a neighbor, or when that "it will just take a minute" research or search for a stock photo takes longer than just a minute.
I've noticed there may also be a correlation between the slow lag times and the number/frequency of automatic post revisions start happening. This may relate to the autosave revisions discussed in #7502.
At about 20 minutes with the editor window open, I have 7 post revisions and my 7,000 word article becomes painfully slow to scroll through and edit. After manually clearing out the revisions and restarting Chrome/Safari I am able to edit and work as expected again - but only for a limited amount of time before it starts to lag once more and there are more automatic post revisions.
I am going to try editing wp-config to adjust the revisions settings and test that to see if at least for now will provide a workaround on sites that are live and running WP 5.0.1. If there is anything else I can do to test or provide info on please let me know what info or testing I could provide feedback on that might be useful.
There was an informal discussion at this past WordCamp US' contributor day which may be related to what you're experiencing @chellestein , specifically in how Gutenberg manages Undo/Redo history as an accumulating set of snapshots.
The original implementation in #415 explored including a limit on the number of entries tracked in history, but this was later dropped. Currently, the editor will remember the entirety of your changes in an editor session. I think it could be argued either way, but there's some legitimacy to wanting an unlimited undo history. Speaking for myself, in a word processor or IDE it's not uncommon for me to hold Cmd+Z and restore back to a point hundreds of history entries earlier.
The specific discussion at WordCamp US was to this point of whether the accumulating snapshots could hinder performance by occupying too much memory in the browser. The discussion had concluded on some hope that the internal implementation of a browser engine would reuse memory allocations of unchanging values (blocks), where each history entry would largely serve as a pointer to a single shared object in memory.
This may or may not be true, and your experiences could serve as an anecdote of it still being problematic (assuming it _is_ the Undo/Redo history causing the dip in performance). I think this deserves a closer look, and perhaps in parallel a rethink to how history is managed in general toward a more efficient implementation (e.g. one based on diffs, tweaking granularity of undo levels). And, of course, it's important to note this is only one part of the larger topic of overall performance.
In the meantime, while it's certainly not an ideal user workflow, you may find that reloading the page every so often will help.
One way to narrow whether "number of revisions" is a factor is whether a post with many revisions is immediately non-performant when the editor first loads. I suspect that this may not play much of a role in the performance of the editor.
Browser memory limitations definitely could be a possible contributing factor @aduth, especially when you consider many people while working in WordPress may have multiple browser tabs open and other sites open. This also could explain why what I notice in "testing mode" tends to be inconsistent with what happens when I actually try to publish on live sites, where the workflow certainly varies.
I'm not sure if this help, but there is one thing that I noticed while working on a very long post on my blog. It kept crashing mySQL so I logged into my VPS (it's the smallest one on DO) and ran top
.
I noticed that whenever I edited the post, it simultaneously opened up a huge number of php processes which I suspect likely killed mySQL.
I've tested this in both Chrome and Firefox in Mojave. My server runs Ubuntu 16.04 with php 7.0 - I've tested this with php7.1 and 7.2 with the same issues.
One issue I've observed is that with especially large posts, the bootstrapping of the post data with page load becomes a bottleneck, particularly when considering the redundancy of data sent to the client between a post's "rendered" and "raw" content variations (these being the default fields provided through the REST API).
When the block editor loads, a number of REST API endpoints are preemptively run server-side, and their results provided to Gutenberg. This includes the post data:
This is actually intended to _improve_ the load experience by avoiding a delay between the page being displayed and the edited content becoming known.
However, for a large post, the posts endpoint result is significant. Further, Gutenberg only actually considers the content.raw
value, not the rendered
result, which is problematic because:
the_content
filter on a substantial content stringConsidering this, it may be worth exploring options:
raw
and rendered
by some query parameter?_fields
filtering, but on the nested content
propertyraw
content
dual nested properties?Edit: Related #core-restapi Slack discussion (link requires registration)
There was previous discussion around extending _fields
to specify nested fields, see core trac ticket #42094 — if I recall correctly we didn't make progress because there was disagreement around the syntax to use for specifying child property inclusion. I proposed parent.child
dot syntax, @danielbachhuber suggested parent[child]
, JMESPath had some traction based on related plugin usage. We can continue that portion of this discussion over in that ticket, I'd love to see us save on content parsing wherever we can!
Update here, 4.9 was a great release in terms of Performance. The main issues for long posts are now fixed. There are still improvements that can be made here and there but I think we should be closing this issue soon.
Have you tried the infamous "The Florian Brinkmann article". for testing?
The texts I write like this (1000-2000 words) can now be edited quite well. Many thanks and a great job! Thanks to the developers!
There are still performance problems when I format long texts into blocks or if I move the blocks back and forth, but the problem of this issue is solved. Again: thank you very much!
From _me_ one can close this issue.
@wpaustria yes, all good for me.
Ruhig, brauner!
Still nothing works! Brandnew dev insta on nearly unlimited performance VPS.
Tried to copy text with CMD+C and CMD+V and than additional with context menu.
Sill nothing works!
Have a look at my screencast:
https://youtu.be/lttL0TxPFbU
I gave up waiting. Now it's 10 minutes since I made the screencast and nothing appears. No content is shown from "The Florian Brinkmann article".
Works great for me in different browsers, you must have an issue somewhere, a plugin or something else.
Yeah! 4 sure it must be my dev insta...
The testing system is a €100 VPS, the insta is brandnew.
Now I have deactivated all the plugins - as you can see from the video of the screen cast I just made
Still nothing works..
For sure it's my fault.
I'm sorry it doesn't work for you. I'm not saying it's your fault, I'm just trying to find what's going wrong. If you want me to record a screencast to show that it works for me, I can.
If nothing appears, maybe there's a JS error somewhere, which browser are you using?
Freshly installed (*) FF 64 with enabled uBlock origin.
Nothing fancy here.
(*) cause I bought myself a new laptop - and I can warmly recommend it - it's an Acer Swift 5 SF515 ;DD
@wpaustria you need to install and activate the Gutenberg plugin to test the latest version I think.
I just tested my article with Gutenberg 4.9 and it is much better now (still has a small delay (but far away from a type delay that can be measured in seconds), and converting from one classic block to single blocks still takes some time and Firefox asks if the page should be stopped).
I think I found the issue.
TypeError: Argument 1 of Node.removeChild is not an object.
Is this what you see on the console? I think there's probably a javascript error somewhere blocking pasting entirely but nothing related to performance. Let's open a separate issue for it.
Tried it on a freshly installed Chromium:
And considering @florianbrinkmann's proposal, I installed the Gutenberg plugin and tried again..
Have a look at the attempt which didn't lead to have the text copied:
There is a JS problem as you can see in the console...
Thanks for the tests @wpaustria I have the same error when pasting. If you want to try the performance, you can try pasting to the html editor and then converting to blocks.
I'm closing this for now.
Here's the JS bug issue https://github.com/WordPress/gutenberg/issues/13527
@youknowriad with what version or build number you consider this issue fixed? I've tried again after seeing the issue got considered as fixed with the latest plugin version 4.9.0 and retested with the florian brinkmann article. 40 seconds white screen and another 64 seconds FOIT with a local test install in Local by Flywheel. still anywhere near from fixed for the initial load imho. typing performance is at least not stalling and freezing anymore but still far away from a real time typing experience. feels slow-moving.
@youknowriad have you seen my question 18 days ago?!
I tried testing again, I notice that the initial loading time still needs to be improved, I agree. I still think the big performance issues are fixed. Work on performance is not stopping.
so what are your loading times on your computer with the article by florian brinkmann? and are the loading times with gutenberg en par with the loading time with tinymce with the florian brinkmann article? then i would consider the loading times as fixed. but at the moment on my side i have still as stated 40 seconds white screen and 64 seconds foit with gutenberg compared to about 12 seconds overall with tinymce if i remember correctly.
Loading times for me are 15 seconds for Gutenberg and 6 seconds for the classic editor.
But still 2,5 times slower than TinyMCE. But the far more worrying part is your loading time with 15 seconds compared to mine with 104 seconds (btw have you cleared the caches upfront?). I don't know what computer and local setup you are using but my tests were run on a MBP 13" early 2011 with 8 GB of RAM running on Local from Flywheel. I think the computer and device should also be taken into account when dealing with loading times and performance. So I agree that the work on performance never stops but the benchmark for performance should be older less powerful computers and devices not the latest most powerful. I would consider the ticket fixed and ready for afterwards improvement and iteration as soon as Gutenberg is en par with the loading times of TinyMCE on older less powerful machines and device with the article of Florian Brinkmann with caches cleared upfront. Till then I consider the issue not fixed and would keep the issue open.
@youknowriad ok retried with 5.1 right now. MBP early 2011 with 10.13.6 and Local from Flywheel. With WordPress 5.1 no other plugins installed. Used the Florian Brinkmann article and cleared caches upfront in Safari 12.0.3.
With Gutenberg:
59,2 second white screen
78 seconds FOIT
137,2 seconds overall
Installed Classic Editor 1.4 afterwards (also cleared caches upfront again)
11,78 seconds loading time overall
Gutenberg still needs to chop off at least 125,42 seconds so that this ticket could be considered as fixed imho.
@rpkoller Can you please create a separate issue about the initial loading time, I agree there's still some work we should do there. This issue is too long and hard to grasp for contributors at the moment, so I think a new issue is better.
Most helpful comment
Marking high priority and assigning to the next minor release.