Skip to content
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: front-end #45

Closed
4 tasks done
tellyworth opened this issue Aug 4, 2022 · 10 comments · Fixed by #72
Closed
4 tasks done

Performance: front-end #45

tellyworth opened this issue Aug 4, 2022 · 10 comments · Fixed by #72
Assignees
Labels
[Component] Theme Templates, patterns, CSS [Type] Question Needs input from others before actionable

Comments

@tellyworth
Copy link
Contributor

tellyworth commented Aug 4, 2022

Let's put together a checklist of any front-end performance issues (current or potential) that need to be considered. We may not fix them all for initial launch, but the sooner we know about them the better.

  • Use webp for images
  • Load the download modal JS only on download page
  • Load the MU Latest Posts block JS in the footer
  • Largest Contentful Paint image was lazy loaded
@tellyworth tellyworth added the [Type] Question Needs input from others before actionable label Aug 4, 2022
@tellyworth tellyworth moved this from 🛑 Pending discussion to 📋 To do in WordPress.org Aug 4, 2022
@adamwoodnz
Copy link
Contributor

Desktop performance is acceptable probably, but there are 3 opportunities for improvements:

Screen Shot 2022-08-08 at 12 26 23 PM

Mobile performance is most likely unacceptable, mostly the same opportunities:

Screen Shot 2022-08-08 at 12 29 22 PM

Image formatting and sizing, and optimisation of JS loading seem to be the key areas to focus on.

@adamwoodnz adamwoodnz moved this from 📋 To do to 🏗 In progress in WordPress.org Aug 8, 2022
@adamwoodnz
Copy link
Contributor

I've now replaced all the large images in the front page with .webp versions and that opportunity has been dismissed. The scores have dropped a little, but it seems the the JS issues have more impact.

@adamwoodnz
Copy link
Contributor

Download page desktop score is excellent. Mobile shows similar issues to front page:

Screen Shot 2022-08-08 at 2 12 54 PM

@adamwoodnz
Copy link
Contributor

Gutenberg issue raised related to JS loading: WordPress/gutenberg#43054

@adamwoodnz adamwoodnz added the [Component] Theme Templates, patterns, CSS label Aug 9, 2022
@ryelle
Copy link
Contributor

ryelle commented Aug 9, 2022

@adamwoodnz or @renintw Can you put together a checklist of any items that still need to be done?

@adamwoodnz
Copy link
Contributor

adamwoodnz commented Aug 9, 2022

Lighthouse scores are very good now, only Download page on mobile is below 90:

Desktop Mobile
Screen Shot 2022-08-10 at 9 30 28 AM Screen Shot 2022-08-10 at 9 31 57 AM
Screen Shot 2022-08-10 at 9 35 29 AM Screen Shot 2022-08-10 at 9 34 54 AM

The download page mobile score is largely due to the wordpress/components import which we have Gutenberg issues for already but needs further discussion after launch.

The remaining opportunities/issues are:

  1. Reduce server response time
    Screen Shot 2022-08-10 at 9 43 22 AM
  2. Eliminate render blocking resources - mostly related to the latest posts block imports
    Screen Shot 2022-08-10 at 9 44 45 AM
  3. Largest Contentful Paint image was lazy loaded - the cover image for 'Dream it, build it' section is lazy loaded
    Screen Shot 2022-08-10 at 9 46 47 AM

Of these I think 2 is the most important. We could look at a webpack tree shaking solution to reduce the size of the import, but also not loading the scripts in head would make a big difference.

@ryelle
Copy link
Contributor

ryelle commented Aug 9, 2022

The homepage should stop loading lodash once GB 13.9 comes out, it looks like wp-element is the only dependant, and the lodash dep has been removed last week (WordPress/gutenberg#42898).

I just made a quick PR to move the latest posts code into the footer: WordPress/wporg-mu-plugins#245 — I'm not sure how much that helps in reality, since some of the deps are still loaded in the header.

@adamwoodnz
Copy link
Contributor

I'm not sure how much that helps in reality, since some of the deps are still loaded in the header.

Just loading that up now to see how much effect it has. There is a ticket for enqueuing block scripts in the footer https://core.trac.wordpress.org/ticket/54018

@adamwoodnz
Copy link
Contributor

  1. Eliminate render blocking resources - mostly related to the latest posts block imports

Merged WordPress/wporg-mu-plugins#245 so this is largely mitigated. react-dom is still loaded in the head and flagged as render blocking. There are other smaller GB scripts which don't get flagged.

@ryelle
Copy link
Contributor

ryelle commented Aug 10, 2022

  1. Reduce server response time

That would be tracked in #44

  1. Largest Contentful Paint image was lazy loaded - the cover image for 'Dream it, build it' section is lazy loaded

Could look into how core adds these attributes, I found a dev note about skipping X images from being lazy-loaded. That could be the answer or it could point us in the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Theme Templates, patterns, CSS [Type] Question Needs input from others before actionable
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants