-
-
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 with Fluent theme and lots of columns is 10x slower removing from view #8389
Comments
Don't put your DataGrid or any other control with virtualization inside of the StackPanel. Additionally, I would still say that it's a bug that removing hundreds of non-virtualized rows freezes the app. But it was previously fixed and can't be reproduced on nightly build (0.10.999-cibuild0021377-beta). So I am going to close this issue. |
By the way, TreeDataGrid might be better choice for you, if you need to display lots of data fast, without editing it. |
Thanks for the tip. It looks like TreeDataGrid has come a long ways since early Avalonia! I'll see if it can handle everything I can throw at it. :) I also should have used a Grid in this demo since I don't really use StackPanel anywhere. It was just easier to use in this example. But it sounds like 0.11 might fix it. |
So I updated my test and the repo to use a Grid instead of a StackPanel. (that was my bad) After running some more tests with the nightly nuget package it appears the issue is still there with the DataGrid and Fluent theme. The most interesting thing is the nightly throws an exception when removing the DataGrid, which I don't see in the current 0.10.15. I'm not sure if that's because there's extra debug logging with the nightly, or if it's a new regression in the nightly:
Here's some more numbers. I also added in some TreeDataGrid numbers, which does appear to be faster removing than the DataGrid with Fluent, but not faster than the DataGrid with the base Light Theme. There's probably quite a few features needed before I could switch to the TreeDataGrid, but it looks promising as an eventual option. Avalonia 0.10.15, Fluent Theme:
Avalonia 0.10.15, Light Theme:
Avalonia Nightly (0.10.999-cibuild0014036-beta), Fluent Theme:
Avalonia Nightly, Light Theme:
|
Profiling this on 30% of the time taken when removing the I'm going to write a few benchmarks and open a PR for this. An initial POC shows a reduction of time taken to detach the |
As per discussion, out adorners aren't perf-optimal. But DottedLineFocusAdorner specifically is not used by many applications, disabled by defaul. And still causes perf degradation even if not used. Create PR to remove it. |
Improves the situation in e.g. #8389 drastically.
Improves the situation in e.g. #8389 drastically.
Opened a PR to improve class selector performance #8433 |
Thanks for all the quick fixes everyone! This was the biggest blocker for the Fluent upgrade, so hopefully I can get that updated soon! |
Describe the bug
When the Fluent theme is used, a DataGrid with lots of columns (20+) is very slow when removed from the UI. (about 20x slower than adding) Using the base Light theme is about 70x faster when removing the control.
To Reproduce
A few notes:
Expected behavior
Using the Fluent theme and lots of DataGrid columns, the DataGrid removal should match the performance of the base light theme.
Alternatively, some workaround to speed up removal would help. (although other people will probably run into this problem too)
Screenshots
Desktop (please complete the following information):
Additional context
Timings for the sample app using using different themes:
Width=2864
Light Theme, resized and half of columns showing
Light Theme, all columns showing
Fluent Light, resized and half of columns showing
Fluent Light, all columns showing
The text was updated successfully, but these errors were encountered: