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

[docs-infra] Improve page transition speed #38394

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Aug 9, 2023

The problem

Open https://mui.com/joy-ui/react-button/ and try to navigate to the Button Group page

Screenshot 2023-08-09 at 13 09 30

560ms. Note that the Material UI Button -> ButtonGroup page transition also feels really bad, it's only 100-150ms faster: 430ms. According to https://web.dev/vitals/ great is at <100ms. I think where it's killing us comes next.

  1. Google Search will use a new performance ranking metric, we don't do well:
Screenshot 2023-08-09 at 13 36 33

https://search.google.com/search-console/core-web-vitals/summary?resource_id=sc-domain%3Amui.com&device=2#inp-table

  1. Second, compare the experience to https://www.radix-ui.com/themes/docs/components/button to move to the Checkbox page:
Screenshot 2023-08-09 at 13 11 44

It's x4 better. Same on https://ui.shadcn.com/docs/components/button, it's at about 130ms. So as a developer, my first impression is: "No, I'm not using Material UI, it's not fast enough".

It is to be noted that it's a regression, something significant broke it: v5.0.6 feels so much better https://v5-0-6.mui.com/components/button-group/

Screenshot 2023-08-09 at 13 31 51

Two ideas of what might have broken it: maybe it's live demo related, maybe it's theme provider related.

The patch

This PR is not a fix, we should find the root cause of the regression and fix it. I think it's one of the highest ROI tasks we have today. I was triggered by browsing https://www.radix-ui.com/themes/docs/overview/getting-started and feeling this big difference. That's why I'm allocating a bit of time to it to shape the problem and some leads of solution. This PR illustrate how a stable layout between page is beyond performance, and is also a nicer UX.

Preview: https://deploy-preview-38394--material-ui.netlify.app/joy-ui/react-button/

Screenshot 2023-08-09 at 13 31 45

We are doing about x2 better.

@alexfauquette From this exploration, I think https://www.notion.so/mui-org/Migrate-all-pages-to-Page-getLayout-212d920a9ab245f08ac3a2aea874f1bc is actually not really so much of the root problem, but more of a side win. I reorganized the Notion tasks to use parent & children tasks.

@oliviertassinari oliviertassinari added scope: docs-infra Specific to the docs-infra product performance labels Aug 9, 2023
@mui-bot
Copy link

mui-bot commented Aug 9, 2023

Netlify deploy preview

https://deploy-preview-38394--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 1c0bfd8

@oliviertassinari oliviertassinari requested review from alexfauquette and removed request for siriwatknp August 10, 2023 22:45
@alexfauquette alexfauquette reopened this Aug 11, 2023
@alexfauquette
Copy link
Member

alexfauquette commented Aug 11, 2023

Didi some investigation. Here is the plot of the time to go from checkbox to button group for different versions of the docs (I used the preview of release PR)

image

The two gaps in performances are for

  • v5.8.7 -> v5.8.8 (5.8.8 never got merged: v5.8.8 #33468)
  • v5.13.5 ->v5.13.6

We now have some clue about when we broke performances, I will have a look at those release next week

Refinement for the PR causing this issue sorted by position in master history:

For v5.8.7 -> v5.8.8

Those PRs included in the release have bad performances:

For v5.13.5 ->v5.13.6

Those PRs included in the release have bad performances:

@oliviertassinari
Copy link
Member Author

@alexfauquette awesome

@oliviertassinari oliviertassinari merged commit c8cf242 into mui:master Aug 11, 2023
24 checks passed
@oliviertassinari oliviertassinari deleted the docs-infra-page-speed branch August 11, 2023 23:20
@danilo-leal danilo-leal changed the title [docs] Improve page transition speed [docs-infra] Improve page transition speed Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants