-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
good first issueGood for newcomers — GitHub surfaces this in the Contribute tabGood for newcomers — GitHub surfaces this in the Contribute tab
Description
Found 100+ occurrences: new ObjectMapper()
ObjectMapper is heavy-weight and thread safe. It should be resused.
according to JacksonFAQ:
Is ObjectMapper thread-safe?
Short answer: yes
Long answer: yes, as long as you always configure instance before use, and do not call configure methods during operation (or synchronize such calls appropriately). Usually it is better to construct separate mapper instance if configurations differ in any case.
Further: it is beneficial to use just one instance (or small number of instances) for data binding; many optimizations for reuse (of symbol tables, some buffers) depend on ObjectMapper instances being reused.
For more information, check out JacksonFAQThreadSafety
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomers — GitHub surfaces this in the Contribute tabGood for newcomers — GitHub surfaces this in the Contribute tab