-
Notifications
You must be signed in to change notification settings - Fork 155
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
support config for jackson buffer recycler pool #1192
Conversation
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
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bounded-pool-size = 100
, is it a recommended value in prod environments ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the Jackson default - ie the default in the Jackson code
It looks good. |
@@ -72,5 +73,29 @@ class JacksonFactorySpec extends TestKit(ActorSystem("JacksonFactorySpec")) | |||
val streamWriteConstraints = mapper.getFactory.streamWriteConstraints() | |||
streamWriteConstraints.getMaxNestingDepth shouldEqual maxNestingDepth | |||
} | |||
"support BufferRecycler (default)" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an empty line.
val recyclerPool = mapper.getFactory._getRecyclerPool() | ||
recyclerPool.getClass.getSimpleName shouldEqual "ThreadLocalPool" | ||
} | ||
"support BufferRecycler with config override" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an empty line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks.