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

Optimize site performance #331

Open
jimaek opened this issue May 30, 2020 · 12 comments
Open

Optimize site performance #331

jimaek opened this issue May 30, 2020 · 12 comments

Comments

@jimaek
Copy link
Member

jimaek commented May 30, 2020

Our mobile rank https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.jsdelivr.com%2Fpackage%2Fnpm%2Fjquery is only 43.
We really need to fix that.

If anyone has time to go through the code to optimize the performance on mobile and desktop please do. Make sure nothing breaks of course.

I will check it out later myself if nobody takes over this task.

Switch fonts to CSS2 https://developers.google.com/fonts/docs/css2

@MartinKolarik
Copy link
Member

I fixed the easy things but our main issue here is loading more JS that needed and changing that requires some architecture improvements. Also even with that, I'll again argue the website is not at all slow and you shouldn't take that test too seriously (and we still get more points than https://www.npmjs.com/package/jquery)

@MartinKolarik
Copy link
Member

Got 70 points now on mobile, 98 on desktop (and we're not really targeting mobile with the package pages, are we?).

@jimaek
Copy link
Member Author

jimaek commented May 30, 2020

Normally I wouldn't care that much about the rating but we are getting an SEO hit because of this https://dl.dropboxusercontent.com/s/91fgxb5ryxi4tnp/chrome_CZnfNp1Lnf.png

Thats why I created the task

@MartinKolarik
Copy link
Member

It could be that the file listing or versions take long to load from the API or something like that. There's no way this has "poor" performance on desktop on its own.

@MartinKolarik
Copy link
Member

Which of the metrics does it complain about?

@jimaek
Copy link
Member Author

jimaek commented May 30, 2020

Cumulative Layout Shift (CLS)

@MartinKolarik
Copy link
Member

Ok that was important because your initial post was about mobile rank but this is about desktop.

@XhmikosR
Copy link
Contributor

XhmikosR commented Jul 3, 2020

It's a tricky thing but I believe it's because some stuff in the viewport are rendered after the initial layout paint, thus leading to a layout shift.

There are some sort of easy tweaks you could make:

  1. load Google Fonts with display=swap or whatever you prefer
  2. update all third-party libs
  3. async load all JS files
  4. code split all the things
  5. lazyload images
  6. make sure you always specify image dimensions
  7. ideally inline the critical CSS

@jimaek
Copy link
Member Author

jimaek commented Aug 24, 2021

Need to focus on this on the new redesigned website
googleperf

@jimaek
Copy link
Member Author

jimaek commented Jan 22, 2023

The new site is live, performance optimization work can begin. We're currently failing many metrics

@jimaek
Copy link
Member Author

jimaek commented Feb 2, 2023

@MartinKolarik
Copy link
Member

Moving to low priority as there may still be some improvements possible, but we now achieve a near-perfect performance score for desktop and a very good one for mobile too.

image

desktop:
image

mobile:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants