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

Cache FieldDescriptors when deserializing Protobufs

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • avatica-1.7.0
    • avatica
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment