Let ObjectMappers callers select the Jackson buffer recycler pool#3511
Open
parker89 wants to merge 1 commit into
Open
Let ObjectMappers callers select the Jackson buffer recycler pool#3511parker89 wants to merge 1 commit into
parker89 wants to merge 1 commit into
Conversation
Generate changelog in
|
70d91fb to
0d0bef0
Compare
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.
Adds
ObjectMappers.RecyclerPoolType{THREAD_LOCAL,SHARED} andRecyclerPoolType-accepting overloads on the factory/mapper methods. Default is unchanged (THREAD_LOCAL= Jackson's default), so this is a pure, opt-in API addition.Motivation: Jackson's default
BufferRecyclerpool is thread-local, which virtual threads defeat — each short-lived vthread reallocates its parse/generate buffers instead of recycling them (observed as ~900 MB/s of extrabyte[]/char[]churn viaBufferRecycler.balloc/callocin a vthread service). Callers that run on virtual threads can now passSHAREDto get a thread-identity-independent pool.The selection is an explicit caller decision rather than runtime thread detection: a caller that knows its execution model (e.g. witchcraft, which knows whether the request pool is virtual) picks the pool. Wiring it through the server (conjure-undertow
Encodings) and, if desired, clients (dialogue-serde) is left to follow-up PRs in those repos.