Skip to content

Conversation

hez2010
Copy link
Member

@hez2010 hez2010 commented Jun 14, 2020

  • Added BulkObservableCollection: support bulk operations based on ObservableCollection, and make sorting process faster
  • Optimize SelectAll: call non-public method DataGrid.SelectAll() to make Select All operation as fast as Ctrl+A

A further question:
How to optimize Invert Selection? DataGrid used SetRowsSelection() internally for fast selection operation, I think we can make it use for implementing faster Invert Selection.

https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/4aca25975f3cec90d4f86d5b5239aa6bc185880b/Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridRows.cs#L797

@hez2010 hez2010 changed the title Optimizations: Improve performance greatly Optimizations: Improve performance greatly on bulk operations Jun 14, 2020
@ghost ghost added the needs - code review label Jun 14, 2020
@yaira2
Copy link
Member

yaira2 commented Jun 14, 2020

@hez2010 Will this work for the grid layouts as well?

@yaira2 yaira2 changed the title Optimizations: Improve performance greatly on bulk operations Improve performance on selection operations Jun 14, 2020
@yaira2 yaira2 self-requested a review June 14, 2020 17:59
@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Jun 14, 2020
@yaira2
Copy link
Member

yaira2 commented Jun 14, 2020

@hez2010 Great work! I am not sure about inverting the selection but it's a already a great improvement for selecting and clearing the selection.

@yaira2 yaira2 merged commit 95cb0a0 into files-community:master Jun 14, 2020
@hez2010
Copy link
Member Author

hez2010 commented Jun 15, 2020

I have not tested this with grid layout yet, but I think it should work.

@hez2010
Copy link
Member Author

hez2010 commented Jun 15, 2020

Update: Grid layout uses a separated logic for SelectAllItems, it's already fast enough. This PR only affects the behavior of list layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants