Opt out of the TypeFactory cache until we can resolve cache contention #2595
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.
Before this PR
FasterXML/jackson-databind#3876
FasterXML/jackson-benchmarks#5
The linked benchmarks show a small advantage of caching over not caching in most cases, in the best case for a cache: when a single operation is repeatedly executed. In practice, the cache is used for all operations and sees heavy evictions, where contention is more likely and has greater impact on users.
Given the hash collision issues that we're aware of, and the impacts we've observed, we will remove the cache until a version is available which isn't impacted by the linked issue for performance that's more predictable.
After this PR
==COMMIT_MSG==
Opt out of the TypeFactory cache until we can resolve cache contention
==COMMIT_MSG==
Possible downsides?
No caching may result in worse performance in the best cases, but avoids cross-thread contention on overloaded buckets which result in exceedingly long operations.