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

perf: Add a fast path for GetValue #13848

Closed
wants to merge 1 commit into from

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Sep 27, 2023

Draft for now as I don't want this to get merged without a clear demonstration of an improvement (if any)

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

Copilot Summary

🤖 Generated by Copilot at 0112ea9

This pull request improves the efficiency and correctness of dependency property handling in Uno Platform. It optimizes the GetValue method in DependencyObjectStore.cs to avoid unnecessary allocations and checks, and fixes the inheritance configuration of properties in DependencyPropertyDetailsCollection.cs.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@@ -265,6 +265,37 @@ private void Dispose(bool disposing)

ValidatePropertyOwner(property);

// As a performance optimization, avoid creating the property details and try get the value in this fast path.
if ((propertyDetails ??= _properties.FindPropertyDetails(property)) is null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting optimization! Let's see what the build says.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Youssef1313 Looks like the build is globally passing, though there are some unit tests that are not passing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Youssef1313 could you take a look at those tests? Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeromelaban I bypassed this optimization for attached properties as that's all what the failing tests about.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Youssef1313 so you'd need to change the test, is that what you mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change the test. Instead, I modified the code to avoid the new optimization when the property is attached. However, looks like some other tests are still failing :/

@Youssef1313 Youssef1313 marked this pull request as ready for review February 12, 2024 20:43
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-13848/index.html

@jeromelaban jeromelaban marked this pull request as draft April 24, 2024 14:42
@Youssef1313
Copy link
Member Author

This is no longer needed given the work in #18001

@Youssef1313 Youssef1313 deleted the perf-get-value branch August 29, 2024 17:40
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

Successfully merging this pull request may close these issues.

3 participants