AvaloniaUI / Avalonia.Controls.TreeDataGrid

A combined TreeView/DataGrid for Avalonia.
MIT License
266 stars 54 forks source link

Selecting too many nodes blocks the UI thread #222

Closed danipen closed 12 months ago

danipen commented 1 year ago

In the demo app, if you select a large number of nodes (around 15k), it makes the app slow and unresponsive. This happens because the selection process takes a long time and it's happening on the main UI thread.

Steps to reproduce:

You can see the problem in this video:

https://github.com/AvaloniaUI/Avalonia.Controls.TreeDataGrid/assets/501613/6795679f-27c8-42e5-b816-89b9dc69ec1b

grokys commented 12 months ago

Just tried, and indeed it was slow, so I hit pause and noticed that it's logging a load of messages to the debug window. If I comment out these lines from the sample app, it's instantaneous on my machine:

https://github.com/AvaloniaUI/Avalonia.Controls.TreeDataGrid/blob/master/samples/TreeDataGridDemo/ViewModels/FilesPageViewModel.cs#L215-L218

Could you commenting out those lines on your machine?

danipen commented 12 months ago

Yes, the slowdown was caused by the log. We can close this issue.