Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1091 Reduce Avatica RPC latency umbrella
  3. CALCITE-1092

Cache FieldDescriptors when deserializing Protobufs

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: avatica-1.7.0
    • Component/s: avatica
    • Labels:
      None

      Description

      To determine if a Protobuf message contains an optional attribute (and not the default value), we need to use the appropriate FieldDescriptor and call the hasField(FieldDescriptor) method on the Message.

      Through some profiling, I've found that we spend a non-zero amount of time in the update path doing HashMap operations. The naive implementation I did the first time around would get the necessary FieldDescriptor for each optional attribute in each deserialization. These descriptors are actually singletons, so we're just wasting a lot of time repeatedly accessing the same object in the HashMap over and over again.

        Attachments

          Activity

            People

            • Assignee:
              elserj Josh Elser
              Reporter:
              elserj Josh Elser
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: