Skip to content
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

possible perf issues with Jackson 2.17 #1443

Open
pjfanning opened this issue Mar 14, 2024 · 1 comment
Open

possible perf issues with Jackson 2.17 #1443

pjfanning opened this issue Mar 14, 2024 · 1 comment

Comments

@pjfanning
Copy link
Contributor

See FasterXML/jackson-module-scala#672 Thanks to @plokhotnyuk for doing the research.

jackson-core has a new buffer recycler default in 2.17 that will cause perf issues for some users.

Specifically, creating lots of ObjectMappers that have not been created using shared JsonFactory instances will likely lead to much worse perf with creating byte and char arrays in Jackson. Jackson 2.16 and before used a buffer recycler based on ThreadLocal whose lifecycle was scoped just to the thread as opposed to the new approach where the buffer recycler lifecycle is scoped to the JsonFactory. If you don't use the same JsonFactory when creating ObjectMappers, then you will get new buffer-recycler instances for every instance of ObjectMapper.

@pjfanning
Copy link
Contributor Author

I did a quick review of the json4s usage of Jackson ObjectMapper and it looks like the Jackson changes shouldn't have a major impact. It would still be useful to do benchmark checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant