mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fab1af764d
NgClass has non-negligable performance cost, especially if a different object is provided as NgClass input (which was the case for the NavItemComponent). The perfornace problem was noticed in the scope of the INP score investigations while profiling the https://angular.io/resources page. On this particular page replacing NgClass usage with alternatives results in 20x (!) runtime perf improvement. Such big improvement is possible since we avoid unneeded CSS classes removal / adding in the DOM. Part of #25518 PR Close #48312