Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-4042

Reuse ObjectMapper in SchemaBuilder & JacksonUtils

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.11.3
    • 1.12.1
    • java

    Description

      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 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.

      Attachments

        Issue Links

          Activity

            People

              owvhk Oscar Westra van Holthe - Kind
              acraig Andrew Craig
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m