[ 
https://issues.apache.org/jira/browse/CALCITE-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16680805#comment-16680805
 ] 

Julian Hyde commented on CALCITE-2619:
--------------------------------------

That makes sense. I suggest to make the {{byte[]}} value private, and copy on 
creation, so that no one can mess with it. And make sure that the bytes are 
valid for the charset/encoding on creation.

Consider using an Avatica ByteString, which contains a {{byte[]}} internally 
but is immutable.

You should keep the current constructor, that uses a java.lang.String, for 
"simple" encodings like LATIN1 and UTF16.

> Reduce string literal creation cost by removing charset check
> -------------------------------------------------------------
>
>                 Key: CALCITE-2619
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2619
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Ted Xu
>            Assignee: Julian Hyde
>            Priority: Major
>
> The cost of creating NlsString is very high, due to its charset check. In 
> some cases, e.g., expression evaluate because of Partition Prune, the 
> NlsString creation costs 40%+ of total executor's overhead.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to