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

Daniel Lemire commented on CALCITE-2619:
----------------------------------------

The problem that I see in the code right now is that you take an input a Java 
String. Now, I would think that all Java strings can be represented as UTF-8 or 
UTF16. Is that not the case? If it is not the case, I want to know!

 

So I would think that something like this should be helpful...

 

 
{code:java}
if ((this.charset != StandardCharsets.UTF_8) && (this.charset != 
StandardCharsets.UTF_16)) {
  // verify
} else {
 // assume that the Java String is valid unicode
}
{code}
 

> 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