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

Faster observable resolution for properties #5

Open
YohDeadfall opened this issue Aug 31, 2021 · 0 comments
Open

Faster observable resolution for properties #5

YohDeadfall opened this issue Aug 31, 2021 · 0 comments

Comments

@YohDeadfall
Copy link
Owner

Currently observable resolution is implemented via full scan of a single linked list. In case of many properties it might cause performance degradation.

The solution is to switch the storage on the fly when it reaches some limit. An array sounds like a good solution due to constant time random access. Since .NET uses auto layout for classes, fields are aligned and packed well. It allows us to compute an observable index as offset / IntPtr.Size. In a worst case when fields are tightly packed it will fallback to scan over a few items inside a bucket like it happens for hash sets.

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

No branches or pull requests

1 participant