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

Optimize performance of IncludeMemberByPathSelectionRule #969

Merged
merged 1 commit into from Nov 17, 2018

Conversation

jnyrup
Copy link
Member

@jnyrup jnyrup commented Nov 16, 2018

This PR has three parts:

  • Lazy-loading Segments instead of eagerly in constructor
  • Caching segments for candidates, by wrapping them as a MemberPath
  • Use type check as fail-fast in IsSameAs

@dennisdoomen
Copy link
Member

What are you trying to accomplish with this PR?

@jnyrup
Copy link
Member Author

jnyrup commented Nov 16, 2018

It triggered me that:

  • the candidate memberpath was segmentized 1-3 times in IncludeMemberByPathSelectionRule, while we can do with atmost 1
  • segments were eagerly computed, where I prefer to minimize the work in the constructor
  • the segments were (to me) unnecessarily copied into a List.
  • the candidate memberpath was segmentized before the declaringTypes are compared.

I think IncludeMemberByPathSelectionRule becomes prettier

@dennisdoomen dennisdoomen changed the title lazy and caching GetSegments Optimize performance of IncludeMemberByPathSelectionRule Nov 17, 2018
@jnyrup jnyrup merged commit fe56239 into fluentassertions:master Nov 17, 2018
@jnyrup jnyrup deleted the memberPath branch November 17, 2018 08:05
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.

None yet

2 participants