Skip to content

A more efficient PropertyDataFetcher#1815

Merged
bbakerman merged 1 commit into
masterfrom
1812-more-efficient-property-fetcher
May 21, 2020
Merged

A more efficient PropertyDataFetcher#1815
bbakerman merged 1 commit into
masterfrom
1812-more-efficient-property-fetcher

Conversation

@bbakerman

Copy link
Copy Markdown
Member

This PR provides a more efficient data fetcher so that public field strategy does not have to perform reflective lookups when we have already cached the method / field

So given:

  1. Use reflection to find a publicly accessible getter method - if successful store result in the method cache to save on future reflection operations
  2. If (1) fails reflection is again used to find a non-public getter method - if successful the result of this is stored in the method cache to save on future reflection operations
  3. If (2) fails reflection is used to find a publicly accessible field - if successful the result is stored in field cache.
  4. Finally, if (1), (2), or (3) fail - the field is stored in a negative cache, and null is returned

We now will skip steps 1) and 2) for public fields and we will skip 1) for non public fields.

This will improve the secondary and tertiary lookup performance.

See #1812

@bbakerman bbakerman added this to the 15.0 milestone Mar 9, 2020
@bbakerman

Copy link
Copy Markdown
Member Author

The reason there is no tests is that a manual inspection of the PropertyDataFetcherTest shows it covers these cases really well and hence this is a more efficient refactoring.

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.

2 participants