Josh Elser created CALCITE-1092:
-----------------------------------
Summary: Cache FieldDescriptors when deserializing Protobufs
Key: CALCITE-1092
URL: https://issues.apache.org/jira/browse/CALCITE-1092
Project: Calcite
Issue Type: Sub-task
Components: avatica
Reporter: Josh Elser
Assignee: Josh Elser
Fix For: next
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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)