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 1 commit into from Nov 17, 2018


Copy link

@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

Copy link

@dennisdoomen dennisdoomen commented Nov 16, 2018

What are you trying to accomplish with this PR?

Copy link
Member Author

@jnyrup 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
1 check passed
@jnyrup jnyrup deleted the memberPath branch Nov 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants