-
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
Performance Degradation in the Block Editor after version 18.0.1 for instances with 3000+ block patterns #64219
Comments
cc @ellatrix |
It’s the same as I reported. It can be slow down even with 10 synced patterns if they have dynamic blocks |
this issue same happen with my block editor right now, very lagging on mobile phone wordpress |
Thank you for reporting this! I can reproduce this issue. Given the above setup, the
Which calls gutenberg/packages/block-editor/src/store/utils.js Lines 65 to 66 in 93b4738
If the user selects a block from a different parent ( gutenberg/packages/block-editor/src/store/selectors.js Lines 2418 to 2423 in 93b4738
Would appreciate @ellatrix's input on this in case I missed something obvious 🙏. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Related #64732. |
I did not create it, but I think Anyway, all this stuff is in need of a big refactor. Merging block pattern and reusable blocks selectors was a mistake imo.
We should also use server side search and pagination instead of fetching everything and doing it client side. Not sure why it was ever done that way. |
Would you be able to test #64871? |
Description
I was able to detect significant performance degradation after inserting 3000 block patterns in a clean install of WordPress 6.6. I tested different versions of the Gutenberg plugin, and it looks like this behavior was not present before (and including) version 18.0.1 and was likely introduced after (and including) version 18.1.0 of Gutenberg.
There are delays in multiple actions in the editor, and they all seem to be JS-related, the post editor page loads with no problems, but, after running all the
wp-json/wp/v2/blocks?context=edit&per_page=100&_locale=user&page=<index>
REST requests to load the block patterns in the background the slowness begins - for example: clicking/focusing on a block that is being edited takes around 1 second.I ran some performance tests on Chrome. I have a hard time figuring out what can be wrong there though - this is the time it takes to focus on a button and for the top context bar to show up:
Step-by-step reproduction instructions
wp eval 'for ($i = 1; $i <= 3000; $i++) { wp_insert_post(["post_title" => "Reusable Block " . $i, "post_content" => "<!-- wp:paragraph --><p>This is block " . $i . "</p><!-- /wp:paragraph -->", "post_status" => "publish", "post_type" => "wp_block"]); }'
wp-json/wp/v2/blocks?context=edit&per_page=100&_locale=user&page=<index>
REST requests run in the background (for me it takes around 10 seconds) the editor lag should begin. Click on one button, then click on another button. The context bar for the button should take a long time to show up, more than 1 second.Screenshots, screen recording, code snippet
Screenshare.-.2024-08-03.3_44_27.AM.mp4
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
The text was updated successfully, but these errors were encountered: