support config for jackson buffer recycler pool#1192
Merged
pjfanning merged 4 commits intoapache:mainfrom Mar 15, 2024
Merged
Conversation
Member
pjfanning
commented
Mar 14, 2024
- the buffer recycler is an important performance feature in Jackson
- Jackson 2.17 also changes the default pool implementation and this has proved an issue - see Performance regression with 2.17.x FasterXML/jackson-module-scala#672
- my plan for Pekko is to keep the existing ThreadLocal implementation as the default even if Jackson has a different default
laglangyue
reviewed
Mar 15, 2024
| pool-instance = "thread-local" | ||
| # the maximum size of bounded recycler pools - must be >=1 or an IllegalArgumentException will occur | ||
| # only applies to pool-instance type "bounded" | ||
| bounded-pool-size = 100 |
Contributor
There was a problem hiding this comment.
bounded-pool-size = 100 , is it a recommended value in prod environments ?
Member
Author
There was a problem hiding this comment.
this is the Jackson default - ie the default in the Jackson code
Contributor
|
It looks good. |
He-Pin
reviewed
Mar 15, 2024
He-Pin
reviewed
Mar 15, 2024
| val streamWriteConstraints = mapper.getFactory.streamWriteConstraints() | ||
| streamWriteConstraints.getMaxNestingDepth shouldEqual maxNestingDepth | ||
| } | ||
| "support BufferRecycler (default)" in { |
He-Pin
reviewed
Mar 15, 2024
| val recyclerPool = mapper.getFactory._getRecyclerPool() | ||
| recyclerPool.getClass.getSimpleName shouldEqual "ThreadLocalPool" | ||
| } | ||
| "support BufferRecycler with config override" in { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.