Skip to content
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

ConcurrentObservableDictionary is non performant because it also acts like a List #29

Open
stewienj opened this issue Sep 27, 2023 · 1 comment
Assignees

Comments

@stewienj
Copy link
Owner

ConcurrentObservableDictionary is not a straight wrapper around an ImmutableDictionary, instead it has a dual personality where it can be used as a Dictionary or a List. This behaviour stems from a very old requirement that has long been forgotten. Unfortunately this behaviour also has significant performance penalties. The ConcurrentObservableDictionary class should be moved to ConcurrentObservableDictionaryList, and a proper ConcurrentObservableDictionary should be created that works the same way as other classes list ConcurrentObservableHashSet.

This change will be a breaking change for anyone using ConcurrentObservableDictionary as a List. I'm wondering how many people this will affect?

@stewienj
Copy link
Owner Author

stewienj commented Sep 28, 2023

The issue is a bit more complicated. ConcurrentObservableDictionary is non performant in things like BenchmarkDotNet because that is console only, however the IList backing of ConcurrentObservableDictionary allows for Virtualized list panels to load only the required elements. As such I will keep the ConcurrentObservableDictionary as is, but create a ConcurrentObservableDictionaryLite to use instead for small collections which doesn't have the IList interface.

stewienj added a commit that referenced this issue Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant