Files
AtomUI/tools
chinboy cd9613d0bc perf(DataGrid): reduce rows presenter clip allocation
Gallery qualification: DataGridShowCase declares 65 DataGrid instances, and each realized DataGrid template owns one DataGridRowsPresenter.

Operation frequency: DataGridRowsPresenter.ArrangeOverride runs during page navigation layout, resizing, and scroll-triggered layout passes; the previous code allocated one RectangleGeometry per arrange.

Avalonia basis: Visual.Clip is a StyledProperty registered with AffectsRender and InvalidateVisual queues the visual for repaint (.referenceprojects/Avalonia/src/Avalonia.Base/Visual.cs:52-53,141-149,418-421). RectangleGeometry.RectProperty is registered with AffectsGeometry, so the reused geometry updates its platform geometry while this change explicitly invalidates the presenter when Rect changes (.referenceprojects/Avalonia/src/Avalonia.Base/Media/RectangleGeometry.cs:25-33; .referenceprojects/Avalonia/src/Avalonia.Base/Media/Geometry.cs:146-172).

Verification: dotnet build -c Release -f net10.0 tools/performances/AtomUI.Performance/AtomUI.Performance.csproj; dotnet run -c Release -f net10.0 --no-build --project tools/performances/AtomUI.Performance/AtomUI.Performance.csproj -- --verify-datagrid-states; dotnet run -c Release -f net10.0 --no-build --project tools/performances/AtomUI.Performance/AtomUI.Performance.csproj -- --suite datagrid --count 100.
2026-05-26 07:10:17 +08:00
..