Mihaly Szjatinya has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/23380 )

Change subject: IMPALA-13806: Avoid per-function std::locale creation
......................................................................


Patch Set 2:

(2 comments)

Thanks!
@Quanlong, unfortunately I can't notice any consistent performance improve even 
on huge amount of mask() calls. I can try more detailed profiling but maybe an 
overhead, since this change is harmless anyway.

http://gerrit.cloudera.org:8080/#/c/23380/1/be/src/exprs/mask-functions-ir.cc
File be/src/exprs/mask-functions-ir.cc:

http://gerrit.cloudera.org:8080/#/c/23380/1/be/src/exprs/mask-functions-ir.cc@149
PS1, Line 149: &
> Could you explain why we use reference (&) here? Is it still valid after th
The temporary object returned from lambda is bound to static reference and is 
going to live forever. From my research it's a best practice to avoid an extra 
copy / move. Although depending on optimization settings it might be RVO'd 
without reference.


http://gerrit.cloudera.org:8080/#/c/23380/1/be/src/exprs/mask-functions-ir.cc@149
PS1, Line 149: &
>This could be a global (static) constant, which would save the initialisation 
>check on each function call.

That way it's not lazy; we probably don't want this object if mask() is never 
called. Also we don't need a scope outside this function.

> Also, the lambda isn't really needed

Yeah, why not.



--
To view, visit http://gerrit.cloudera.org:8080/23380
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9a611ba1b175b0ab1c8f0d1de3b2439be70a68f7
Gerrit-Change-Number: 23380
Gerrit-PatchSet: 2
Gerrit-Owner: Mihaly Szjatinya <[email protected]>
Gerrit-Reviewer: Daniel Becker <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Mihaly Szjatinya <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Comment-Date: Thu, 04 Sep 2025 16:05:29 +0000
Gerrit-HasComments: Yes

Reply via email to