You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I'm using a DataGrid in my project and have noticed a performance hit when my table is attached to a visual tree. I ran a dotTrace measurement inside the Rider IDE and noticed that the InitializeElements method was taking a long time.
The commit that was made earlier solves one of the problems: #9527
InitializeElements(bool recycleRows) now we use false.
This leads to the fact that every time we connect to the visual tree, we build the columns in the table all over again. But at the same time, we only need to update the rows. We need use only RefreshRows inside method InitializeElements(bool recycleRows).
By the way. Removing the InitializeElements(false /*recycleRows*/); line completely solves the scrolling problem. When you switch to another tab and back. Your scrolling position remains in the same place. I plan to spend some more time solving this problem.
Describe the bug
Hello. I'm using a DataGrid in my project and have noticed a performance hit when my table is attached to a visual tree. I ran a dotTrace measurement inside the Rider IDE and noticed that the
InitializeElements
method was taking a long time.The commit that was made earlier solves one of the problems: #9527
pull:
almightyju@e9f2cb3
But I believe there is a bug in this commit.
InitializeElements(bool recycleRows)
now we usefalse
.This leads to the fact that every time we connect to the visual tree, we build the columns in the table all over again. But at the same time, we only need to update the rows. We need use only
RefreshRows
inside methodInitializeElements(bool recycleRows)
.And so we must replace this:
TO:
My measurements using Stopwatch (I was just switching between tabs):
InitializeElements(false /*recycleRows*/);
InitializeElements(true /*recycleRows*/);
To Reproduce
Open the ready-made DataGrid examples in the avalonia project and start switching between tabs.
Expected behavior
No response
Avalonia version
11.1-rc1
OS
Windows
Additional context
No response
The text was updated successfully, but these errors were encountered: