Further fix on fastArrayCache
has
#24292
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Further fix on
fastArrayCache
has
We recently got a good performance boost on accessing the
metadata
(and otherfastArray
caches) by improving our 'hit-rate' on intercepting requests at the fast array cache #24156This adds a much smaller boost in intercepts such that the pattern of
results in one lookup of the underlying cache rather than two.
Before
A call to
has
on afastArray
cache does not result in the value retrieved from theget
request that it does being cached to the array so we wind up with two get requests when we dohas
followed byget
- has seems to callget
internally anyway - but not in a way thefastArray
decorator can accessAfter
Using a
get
internally results in the value being cached & available for a second callTechnical Details
it's hard to think of when a
has
would be used without a subsequentget
Comments
This won't impact batch job performance except on the very first cache access - which suggests maybe a 120ms improvement on a single contact save on our infra - that's not a tonne & results may vary - but we have removed queries with far less impact & it's hard to see a downside