-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataGrid performance on attached to visual tree. #16139
Labels
Comments
By the way. Removing the See #15218 |
3 tasks
This should solve both problems. #16140 |
maxkatz6
added a commit
that referenced
this issue
Jul 8, 2024
see #16139 Co-authored-by: Max Katz <maxkatz6@outlook.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: