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/perf] Update babel config #43286

Merged
merged 3 commits into from
Aug 14, 2024
Merged

[docs/perf] Update babel config #43286

merged 3 commits into from
Aug 14, 2024

Conversation

romgrk
Copy link
Contributor

@romgrk romgrk commented Aug 14, 2024

Use this assumption to speed up the spread operator: https://babeljs.io/docs/assumptions#setspreadproperties

Our docs don't use the fast object spread operator, this babel assumption makes code that uses const x = { ...y } faster. This change is already done in X but I haven't had time to do it here as well.

The test case is: open the MUI material docs overview page, then click on the "Button" section. The following graphs show the performance of the first section of code that follows that click event. This section of code is the render functions, and shows an improvement of around 10%.

before after
spread-before spread-after

@romgrk romgrk added performance core Infrastructure work going on behind the scenes docs Improvements or additions to the documentation labels Aug 14, 2024
@romgrk romgrk changed the title [core/perf] Update babel config [docs/perf] Update babel config Aug 14, 2024
@mui-bot
Copy link

mui-bot commented Aug 14, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against eb92610

@romgrk romgrk requested a review from a team August 14, 2024 04:29
Copy link
Member

@aarongarciah aarongarciah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for the improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes docs Improvements or additions to the documentation performance scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants