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

remove object reuse from Java APIs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • java
    • None

    Description

      Avro's Java APIs were designed to permit object reuse when reading with the assumption that would provide performance advantages. In particular, the old parameter in DatumReader<T>.read(T old, Decoder), the Utf8 class, and the GenericArray.peek() method were all designed for this purpose. But I am unable to see significant performance improvements when objects are reused. I tried modifying Perf.java's GenericTest to reuse records, and its StringTest to not reuse Utf8 instances and, in both cases, performance is not substantially altered.

      If we were to remove these then issues such as AVRO-803 would disappear. Always using java.lang.String instead of Utf8 would remove a lot of user confusion.

      Attachments

        1. perf-reuse.patch
          1 kB
          Doug Cutting

        Issue Links

          Activity

            People

              cutting Doug Cutting
              cutting Doug Cutting
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: