-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
MatPaginatedTabHeader has performance problems (forced synchronous layout). #17317
MatPaginatedTabHeader has performance problems (forced synchronous layout). #17317
Comments
I spent some time profiling in against our dev app and it's not just |
Currently the tabs pagination works automatically by measuring the size of the tab header to figure out whether to show pagination. This measuring can be expensive because it triggers a page layout and might not necessarily be required if the page won't have enough tabs to paginate through. These changes add an input and an option to the injection token to allow consumers to opt out of the pagination, if they know that they won't need it. Fixes angular#17317.
Currently the tabs pagination works automatically by measuring the size of the tab header to figure out whether to show pagination. This measuring can be expensive because it triggers a page layout and might not necessarily be required if the page won't have enough tabs to paginate through. These changes add an input and an option to the injection token to allow consumers to opt out of the pagination, if they know that they won't need it. Fixes angular#17317.
Currently the tabs pagination works automatically by measuring the size of the tab header to figure out whether to show pagination. This measuring can be expensive because it triggers a page layout and might not necessarily be required if the page won't have enough tabs to paginate through. These changes add an input and an option to the injection token to allow consumers to opt out of the pagination, if they know that they won't need it. Fixes angular#17317.
Currently the tabs pagination works automatically by measuring the size of the tab header to figure out whether to show pagination. This measuring can be expensive because it triggers a page layout and might not necessarily be required if the page won't have enough tabs to paginate through. These changes add an input and an option to the injection token to allow consumers to opt out of the pagination, if they know that they won't need it. Fixes angular#17317.
Currently the tabs pagination works automatically by measuring the size of the tab header to figure out whether to show pagination. This measuring can be expensive because it triggers a page layout and might not necessarily be required if the page won't have enough tabs to paginate through. These changes add an input and an option to the injection token to allow consumers to opt out of the pagination, if they know that they won't need it. Fixes #17317.
Currently the tabs pagination works automatically by measuring the size of the tab header to figure out whether to show pagination. This measuring can be expensive because it triggers a page layout and might not necessarily be required if the page won't have enough tabs to paginate through. These changes add an input and an option to the injection token to allow consumers to opt out of the pagination, if they know that they won't need it. Fixes #17317.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Reproduction
Steps to reproduce:
Expected Behavior
MatPaginatedTabHeader
should not be the perf hot spot / bottleneck for AIOActual Behavior
The _checkPaginationEnabled methods triggers a forced synchronous layout (by doing
const isEnabled = this._tabList.nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;
.This forced synchronous layout accounts for ~38% of the entire JS processing time on the critical TTI path (see attached recording). Similar bottlenecks were spotted on other profiled sites (ex. https://www.mustakbil.com/)
Dev tools profile recording
The text was updated successfully, but these errors were encountered: