Skip to content

MatPaginatedTabHeader has performance problems (forced synchronous layout).  #17317

@pkozlowski-opensource

Description

@pkozlowski-opensource

Reproduction

Steps to reproduce:

  1. open Chrome dev tools / Performance
  2. start recording a profile and go to https://next.angular.io/guide/router

Expected Behavior

MatPaginatedTabHeader should not be the perf hot spot / bottleneck for AIO

Actual 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

Metadata

Metadata

Assignees

Labels

P2The issue is important to a large percentage of users, with a workaroundperfThis issue is related to performance

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions