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

Misc perf improvements #3570

Merged
merged 4 commits into from
Feb 8, 2024
Merged

Misc perf improvements #3570

merged 4 commits into from
Feb 8, 2024

Conversation

tunetheweb
Copy link
Member

Inspired by @rviscomi 's work on the main HTTP Archive site in HTTPArchive/httparchive.org#796 I've had a look at this site

We're just missing INP target and also have load issues (likely when content is not cached in CDN as quiet time between issues):

image

Checking histrorical views it looks like the INP has been better historically so this may be a once off, but would still be nice to get some head room.

image

Our articles are quite big, especially some of them, so while we've been careful with our JS, we could still look at what other layout improvements we could make.

I've made the following changes:

  • Changed use of innerText to textContent to prevent reflow as innerText is aware of CSS so requires a style recalc.
  • Make the "Show Descriptions" buttons below each text visibility: hidden rather than display: none to prevent shifts/layouts when the buttons are activated by JS. Also add a no js full hide to avoid the gap if buttons aren't activated.
  • Implement speculation rules with moderate eagerness to improve load times when navigating between chapters. Should also help INP if we can get some of that load layout and JS execution out of the way earlier.
  • Add LoAF monitoring for future monitoring - note I've only set these up with the production params with no origin trail token since it's going live soon.

I was not able to verify any noticeable improvement in Perf tracing or Lighthouse as these really are micro-optimisations and there's a lot of variability but still worth doing IMHO.

@tunetheweb tunetheweb merged commit db9e223 into main Feb 8, 2024
10 checks passed
@tunetheweb tunetheweb deleted the misc-perf-improvements branch February 8, 2024 14:02
This was referenced Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants