MyToolkit icon indicating copy to clipboard operation
MyToolkit copied to clipboard

AddRange (although obsolete) is much faster than using operations on the Items collection.

Open jkronk opened this issue 8 years ago • 3 comments

When adding items to an ObservableCollectionView<T>, it is much quicker to use the obsolete method AddRange(IEnumerable<T>) rather than looping through the items and adding them to the ObservableCollectionView<T>.Items collection. The difference is negligible for a few rows, but once there are hundreds or even thousands of rows AddRange is much more efficient. I haven't dug down into why this occurs yet, I just wanted to open it as an issue for investigation.

jkronk avatar Oct 05 '16 21:10 jkronk

Guess this project is pretty much done and over with? Anyone know of any other UWP grid's that have this type of control?

jkronk avatar Feb 08 '17 18:02 jkronk

I still use the library in professional wpf projects. The problem is that UWP does not take off and I dont have the to work on components im not using...

I think you can fix it by providing an MtObservableCollection (with AddRange) to the ctor of ObservableCollectionView.. this is how i do it for all lists - i have an allitems collection which i pass to filtereditems (collection view)

RicoSuter avatar Feb 08 '17 18:02 RicoSuter

cool I will give it a shot. if i find the slow-down i will contact you with a req and maybe you can look it over if you get time.

jkronk avatar Feb 10 '17 22:02 jkronk