Andrew Craig created AVRO-4042:
----------------------------------

             Summary: Reuse ObjectMapper in SchemaBuilder & JacksonUtils
                 Key: AVRO-4042
                 URL: https://issues.apache.org/jira/browse/AVRO-4042
             Project: Apache Avro
          Issue Type: Improvement
          Components: java
    Affects Versions: 1.11.3
            Reporter: Andrew Craig


Currently, calling `JacksonUtils.toJsonNode(obj)`, 
`JacksonUtils.objectToMap(obj)` or `SchemaBuilder.toJsonNode(obj)` recreate at 
least one new instance of Jackson ObjectMapper each time. 

ObjectMapper is an expensive object to create, but is immutable and 
thread-safe. We can see in various other locations within Avro that we reuse 
the same object, and avoid recreation. 

We can perform the same reuse here - and only create the ObjectMapper once.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to