NASA-IMPACT / admg-casei

ADMG Inventory
https://impact.earthdata.nasa.gov/casei/
Apache License 2.0
1 stars 0 forks source link

Improving performance #274

Open AliceR opened 3 years ago

AliceR commented 3 years ago

Improving performance

I just watched a recent talk on Common Mistakes that degrade frontend performance https://www.twitch.tv/videos/994452019 This is a summary of my learnings I am planning to apply on this project:

JS Bundle analysis

  1. gatsby-plugin-webpack-bundle-analyser-v2 wrapper around webpack-bundle-analyser, high level overview of all the bundles on the site. Which bundle is big? Great place to start

  2. gatsby-plugin-perf-budgets Same plugin, but it applies page by page. Better insight into hashed bundles. Which javascript is loaded, app level vs. template level.

These are the sections:

  1. Dev Tools performance tab Profile the page, look for javascript that runs long time. Bundle analysis gives kilobytes, performance tab helps see if javascript loops and gets expensive when executed.

This analysis gives clues on where to apply the next section hints:

Component Level Code Splitting

Out of the box, gatsby does page/template level code splitting. Sometimes you might want component level code splitting.

Global State Management

(not relevant for this project, but adding for completeness and possibly future reference)

(Too) Lazy Images

First and largest contentful paints account for half of the Lighthouse score (LCP).


PS: Gatsby offers a paid service to help improve performance: https://www.gatsbyjs.com/products/concierge/performance

Other resources

https://www.gatsbyjs.com/docs/how-to/performance/improving-site-performance/

AliceR commented 3 years ago

😱 Running a lighthouse audit

Screenshot 2021-04-22 at 15 08 02 Screenshot 2021-04-22 at 15 10 02
AliceR commented 3 years ago

Now, this just happened

Screenshot 2021-04-22 at 18 38 07

It is getting to a point where I wonder if these issues might be related to our recent upgrade to Gatsby v3. But maybe its also just me, adding a platform and instrument image on every platform card, where I should really look into pagination...

Seems like we need to prioritize and tackle this issue earlier than I initially thought.

necoline commented 3 years ago

wow, thanks for diving in to this! It looks like we have our work cut out for us. My guess is that images on all the cards was certainly a big part of this ☝️ . I think v3 only helped with some of our performance issues

AliceR commented 3 years ago

Skipping the card images did make the deploy pass: https://github.com/NASA-IMPACT/admg-inventory/pull/282 I'll open a separate issue for the card images and keep this one focussed on the remaining performance issues.

AliceR commented 2 years ago

Current lighthouse reports for three important pages: