-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[Perf] Avoid React.Children.count traversal for empty state early return #15503
[Perf] Avoid React.Children.count traversal for empty state early return #15503
Conversation
Thanks for submitting this change, but due to work currently in progress to prepare |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit c3def6f:
|
These need to explicitly check |
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Perf comparison
Perf tests with no regressions
|
Asset size changes
Over Tolerance (1024 B) Over Baseline Below Baseline New Removed 1 kB = 1000 B Baseline commit: 8a3c81a98246558bdb80b05e1f1acf32eab34509 (build) |
packages/react-cards/src/components/Card/CardSection/CardSection.view.tsx
Outdated
Show resolved
Hide resolved
Let's wait until after the snap period to merge or spin a v7 version of this PR if needed sooner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guessing this can go in now? Needs some minor change file updates and a merge with master.
change/@fluentui-react-internal-2020-10-13-16-47-27-keco-react-children-for-empty.json
Outdated
Show resolved
Hide resolved
change/@uifabric-react-cards-2020-10-13-16-47-27-keco-react-children-for-empty.json
Outdated
Show resolved
Hide resolved
…-children-for-empty.json
Actually both the change files and the conflicts were easy to fix in the web UI, so I took care of that. |
Thank you @ecraig12345 🙇♂️. @khmakoto can we merge this? |
🎉 Handy links: |
🎉 Handy links: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Pull request checklist
$ yarn change
Description of changes
Avoid calls to
React.Children.count
which recursively traverses child components. The cost grows with component hierarchy. These cases were for early returnnull
so they should be quick. In cases wherechildren
are not passed via props the value isundefined
.Text
for example:Focus areas to test
(optional)
Related: #15462 #15473