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

Improve encode/decode time for SpecificRecord using code generation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.9.0
    • java
    • None

    Description

      New implementation for generation of code for SpecificRecord that improves decoding by over 10% and encoding over 30% (more improvements are on the way). This feature is behind a feature flag (org.apache.avro.specific.use_custom_coders) and (for now) turned off by default. See Getting Started (Java) for instructions.

      (A bit more info: Compared to GenericRecords, SpecificRecords offer type-safety plus the performance of traditional getters/setters/instance variables. But these are only beneficial to Java code accessing those records. SpecificRecords inherit serialization and deserialization code from GenericRecords, which is dynamic and thus slow (in fact, benchmarks show that serialization and deserialization is slower for SpecificRecord than for GenericRecord). This patch extends record.vm to generate custom, higher-performance encoder and decoder functions for SpecificRecords.)

      Attachments

        1. customcoders.md
          10 kB
          Raymie Stata
        2. perf-data.txt
          10 kB
          Raymie Stata

        Issue Links

          Activity

            People

              raymie Raymie Stata
              raymie Raymie Stata
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: