Csaba Ringhofer has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/16719 )

Change subject: IMPALA-10323: use snprintf instead of lexical_cast to cast to 
string
......................................................................


Patch Set 1:

> (1 comment)
 >
 > > (1 comment)
 >
 > use buffer may result in lock contention in multi-thread mode where
 > I want to improve performance.
 > To save memory, I have another proposal:
 > May be we can define 3 level char size : 5,10,20,
 > for bigint value ,
 > if value<99999999999 && value > -999999999, then change char_size
 > to 10; else if value <99999 && value>-9999, than change char size
 > to 5;

 > (1 comment)
 >
 > > (1 comment)
 >
 > use buffer may result in lock contention in multi-thread mode where
 > I want to improve performance.
 > To save memory, I have another proposal:
 > May be we can define 3 level char size : 5,10,20,
 > for bigint value ,
 > if value<99999999999 && value > -999999999, then change char_size
 > to 10; else if value <99999 && value>-9999, than change char size
 > to 5;

CopyFrom willl

 > (1 comment)
 > 
 > > (1 comment)
 >
 > use buffer may result in lock contention in multi-thread mode where
 > I want to improve performance.
 > To save memory, I have another proposal:
 > May be we can define 3 level char size : 5,10,20,
 > for bigint value ,
 > if value<99999999999 && value > -999999999, then change char_size
 > to 10; else if value <99999 && value>-9999, than change char size
 > to 5;

CopyFrom allocates memory exactly the same way as the constructor of StringVal 
does in your current solution:
https://github.com/apache/impala/blob/master/be/src/udf/udf.cc#L517

both will end up in AllocateForResults -
https://github.com/apache/impala/blob/master/be/src/udf/udf.cc#L470
which uses a mempool dedicated to this thread, so it shouldn't cause any 
contention in multi-threaded code


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ief1d6b2c2cb5961c1d6cee1b0eac86ab61509768
Gerrit-Change-Number: 16719
Gerrit-PatchSet: 1
Gerrit-Owner: wesleydeng <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Gabor Kaszab <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-Reviewer: abeltian <[email protected]>
Gerrit-Reviewer: wesleydeng <[email protected]>
Gerrit-Comment-Date: Tue, 17 Nov 2020 13:27:15 +0000
Gerrit-HasComments: No

Reply via email to