Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Editor loads slowly in Calypso and wp-admin #45155

Closed sirreal closed 4 years ago

sirreal commented 4 years ago

Describe the bug When opening the editor in Calypso and wp-admin it is very slow to open.

To reproduce Steps to reproduce the behavior: Its a simple site, the pages/posts in Calypso and WP-Admin open incredibly slow. For one HE it took 30 seconds for a page/post to open after being clicked. Everything else opens fine though. They have 1000+ pages and 7000+ posts but File Tools shows their usage is 1194.98 Mb. User says the slowness started after the block editor was added Happens on multiple browsers and systems

Expected behavior Pages and posts to open promptly

LINKS:

3217835-zd

Orginially posted by @rickmgithub in https://github.com/WordPress/gutenberg/issues/24692

simison commented 4 years ago

cc @tyxla since you've been looking into editor performance recently.

tyxla commented 4 years ago

Thanks for the ping. Taking a look, but my first impressions are this is a Memcache problem at how the widget conditional visibility logic is handled and not at all related to the Gutenberg editor itself. Stay tuned.

tyxla commented 4 years ago

Going to cc @david-binda who mentioned he's going to have a deeper look into it as per: p1601547760149500-slack-C4GAP2RHD ?thread_ts=1601544173.145100&cid=C4GAP2RHD

tyxla commented 4 years ago

I've dug further and suggested disabling of the Widget Visibility for the block editor, see p7H4VZ-2KJ-p2 for details and suggestions. This should drastically improve the block editor performance (TTFB in particular) for this particular site. Reviews are welcome!

tyxla commented 4 years ago

I've just shipped the related diff on WP.com. Editor loads significantly faster now, with TTFB < 1s for me.

Do you think we can close this one @sirreal and @simison?

simison commented 4 years ago

@tyxla fine by me to close this one, and keep observing RUM data for editor loading times.

Editor loads significantly faster now, with TTFB < 1s for me.

😌 You're a hero!

What do you think about P2ing about the state of average customer's editor speed for awareness and how can we make sure we don't regress?

simison commented 4 years ago

Oh and Atomic editor loading speed is still an issue due redirects somewhere, right?

tyxla commented 4 years ago

What do you think about P2ing about the state of average customer's editor speed for awareness and how can we make sure we don't regress?

Great idea! FWIW we've been discussing doing that at @Automattic/team-calypso, but just want to get a bit more data after the recent updates before analyzing and p2-ing with it.

Oh and Atomic editor loading speed is still an issue due redirects somewhere, right?

Not really 😉 There are necessary redirects because of how auth is setup to work on the first load for Jetpack and Atomic, but the subsequent unnecessary Calypsoify redirect has already been removed in https://github.com/Automattic/jetpack/pull/17286 and D50124-code. That was part of the latest Jetpack release and is already running in production for Jetpack and Atomic sites. 😉

That being said, loading speed is still an issue even after all those improvements and we'll continue auditing and fixing various instances that affect the user-perceived performance.

tyxla commented 4 years ago

Since the editor used to take an average of 14 seconds to load, and now it takes less than a second, this one is ready to be closed. Details on how we fixed this can be found in p7H4VZ-2KJ-p2.

Closing, thanks everyone 🙌