-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Memoize flattened property lookup #31494
Conversation
/cc @danmoseley |
OK, if in your judgement risk is low. |
/// Returns all <see cref="IProperty"/> members from this type and all nested complex types, if any. | ||
/// </summary> | ||
/// <returns>The properties.</returns> | ||
public virtual IEnumerable<Property> GetFlattenedProperties() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be public given that they're supposed to be memoized? Or are we doing memoization only for the runtime types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean. They aren't memoized for non runtime properties (because the types returned can change). But even if they were, why does being memoized mean they should be non-public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They aren't memoized for non runtime properties (because the types returned can change).
Right, makes sense.
But even if they were, why does being memoized mean they should be non-public?
I just meant that where we memoize, we shouldn't provide public access to the logic that does the costly calculation, bypassing the memoization. All seems ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check with @andriipatsula @AndriySvyryd on this. I think I followed the existing pattern on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine. Costly methods won't be available once the model is finalized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with simplification/memoization remarks below
0d5d55d
to
6b219eb
Compare
Per #31453 (review)