Skip to content

perf(grid): fix style recalculation regressions in grid themes and component styles - #17839

Merged
ChronosSF merged 10 commits into
masterfrom
simeonoff/performance-fixes
Oct 30, 2026
Merged

ChronosSF merged 10 commits into
masterfrom
simeonoff/performance-fixes

Conversation

@simeonoff

Copy link
Copy Markdown
Member

Closes #17793
Addresses (a) of #17794. Part (b) is out of scope (see the issue thread), and (c) plus the Excel-style filter menu are follow-ups.

Description

Motivation / Context

Both are performance regressions in the grid since 22.0 and 22.1. Measured at 4× CPU throttling, as main-thread time:

Operation Before → after
First filter + sort 121 → 101 ms
Next filter 99 → 80 ms
Row edit enter / exit 72 → 44 ms / 44 → 19 ms
isLoading on / off 75 → 49 ms / 56 → 33 ms
Boolean / string cell edit 64 → 22 ms / 71 → 33 ms
Load +0.5–2%

The JS bundle grows by 12 bytes; no CSS is duplicated.

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

Grid (all variants), Theming, IgxStylesRegistrar

How Has This Been Tested?

Test Configuration:

  • Angular version: 22.2.3
  • Browser(s): Chromium (Playwright 1.64.1)
  • OS: macOS

Screenshots / Recordings

N/A, no visual changes.

Checklist:

  • All relevant labels have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

Chromium (and WebKit) only bucket a rule by a :where()/:is() subject
when it holds a single selector; multi-argument lists land in the
universal bucket and are matched against every element on each style
recalculation. Wrap each selector of the scope() list in its own
:where(), and split the header item rule the same way. Specificity and
matching are unchanged.

Closes #17793
Angular removes a ViewEncapsulation.None component's styles with its
last instance and re-inserts them with the next, restyling the page.
Add IgxStylesRegistrar.retain() to keep them via one detached instance
per app, and retain the components the grid creates and destroys while
filtering, grouping, editing and loading.

Refs #17794
@ChronosSF

Copy link
Copy Markdown
Member

@simeonoff , please solve the merge conflict

…ce-fixes

# Conflicts:
#	CHANGELOG.md
#	projects/igniteui-angular/core/src/core/styles/themes/_scoping.scss
@simeonoff

Copy link
Copy Markdown
Member Author

@simeonoff , please solve the merge conflict

Done.

ChronosSF and others added 5 commits October 26, 2026 19:10
@ChronosSF ChronosSF added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Oct 30, 2026
@ChronosSF

Copy link
Copy Markdown
Member

@simeonoff , can you fix the conflict?

…ce-fixes

# Conflicts:
#	projects/igniteui-angular/input-group/src/input-group/input-group.component.spec.ts
@ChronosSF
ChronosSF merged commit 9b078bc into master Oct 30, 2026
7 checks passed
@ChronosSF
ChronosSF deleted the simeonoff/performance-fixes branch October 30, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

grid: performance theming ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance regression: multi-argument :where() theme selectors slow grid style recalculation since 22.0.0

2 participants