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

ASF subversion and git services commented on IMPALA-13806:
----------------------------------------------------------

Commit 4577cab3e81fede477b6a9ec8868133bab325ba2 in impala's branch 
refs/heads/master from Mihaly Szjatinya
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=4577cab3e ]

IMPALA-13806: Avoid per-function std::locale creation

A new std::locale is constructed at each mask*() function call while in
UTF8_MODE. Instead use a static local object.

Change-Id: I9a611ba1b175b0ab1c8f0d1de3b2439be70a68f7
Reviewed-on: http://gerrit.cloudera.org:8080/23380
Tested-by: Impala Public Jenkins <[email protected]>
Reviewed-by: Quanlong Huang <[email protected]>


> Avoid per-function std::locale creation
> ---------------------------------------
>
>                 Key: IMPALA-13806
>                 URL: https://issues.apache.org/jira/browse/IMPALA-13806
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>            Reporter: Csaba Ringhofer
>            Assignee: Mihaly Szjatinya
>            Priority: Major
>              Labels: ramp-up
>
> https://github.com/apache/impala/blob/4c549d79f2648c5ed906deef42c8d05bb747d8b0/be/src/exprs/mask-functions-ir.cc#L151
> The line above creates a local on every invocation of the mask function.
> This has 2 issues:
> 1. probably makes the function slower
> 2. it may turn out during execution that the locale cannot be created, 
> leading to an exception (and crash at the moment)
> std::locale/facet is thread safe (and immutable) based on 
> https://en.cppreference.com/w/cpp/locale/locale
> A locale could be created per fragment instance or a global "en_US.UTF-8" 
> could be used at all places.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to