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

Improve Avro Double and Float Encode Performance

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.10.0
    • None
    • None

    Description

      I was looking at how Avro encodes Doubles and Floats and comparing it to Java's.

      So, I checked it out and found that the Java version for Floats is faster than Avro using the Avro perf tests:

      # Avro Impl
      FloatTest.encode  thrpt    3  273709210.133 ± 49629107.871  ops/s
      FloatTest.encode  thrpt    3  271515727.631 ± 57405372.266  ops/s
      
      # Java Impl
      FloatTest.encode  thrpt    3  278234438.923 ± 34633982.243  ops/s
      FloatTest.encode  thrpt    3  284801936.136 ± 52273884.157  ops/s
      

      Interestingly, I wasn't able to reproduce this gain with Doubles. Avro's version was faster. However, we can remove the bitwise mask (Java doesn't bother to do it).

      https://github.com/openjdk/jdk/blob/6bab0f539fba8fb441697846347597b4a0ade428/src/java.base/share/classes/java/io/Bits.java#L105

      Attachments

        Issue Links

          Activity

            People

              belugabehr David Mollitor
              belugabehr David Mollitor
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: