mapleFU commented on code in PR #43763:
URL: https://github.com/apache/arrow/pull/43763#discussion_r1738056046


##########
cpp/src/arrow/compute/row/row_encoder_internal.cc:
##########
@@ -145,41 +145,35 @@ void FixedWidthKeyEncoder::AddLengthNull(int32_t* length) 
{
 
 Status FixedWidthKeyEncoder::Encode(const ExecValue& data, int64_t 
batch_length,
                                     uint8_t** encoded_bytes) {
+  auto handle_next_valid_value = [&](std::string_view bytes) {

Review Comment:
   Emm let me post a blog in chinese: 
https://www.ykiko.me/en/articles/692886292/
   
   > The efficiency of passing structures smaller than 16 bytes by value is 
higher than by reference
   This statement has been around for a long time, but I have never found the 
basis for it. Finally, when I was studying the calling convention recently, I 
found the reason. First of all, if the structure size is less than or equal to 
8 bytes, it can be directly stuffed into a 64-bit register for parameter 
passing. Passing parameters through registers requires fewer memory accesses 
than passing parameters through references, which is more efficient and no 
problem. What about 16 bytes? System V ABI allows a 16-byte structure to be 
split into two 8-byte parts, and then passed using registers separately. In 
this case, passing by value is indeed higher than passing by reference.
   
   In general, they would be same, and passing by value is same. And 16b can be 
more lightweight in some abi.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to