Dandandan commented on code in PR #20807:
URL: https://github.com/apache/datafusion/pull/20807#discussion_r2903375923


##########
datafusion/physical-expr-common/src/binary_view_map.rs:
##########
@@ -292,6 +292,19 @@ where
 
             // Extract length from the view (first 4 bytes of u128 in 
little-endian)
             let len = view_u128 as u32;
+            let is_inline = len <= 12;
+
+            // Fetch the input value bytes once to avoid redundant memory
+            // access during hash resolution and insertion.
+            // For inline strings (<=12 bytes), extract bytes directly
+            // from the view (no memory fetch needed).
+            // For non-inline strings (>12 bytes), fetch once from the array.
+            let view_bytes = view_u128.to_le_bytes();
+            let input_value: &[u8] = if is_inline {
+                &view_bytes[4..4 + len as usize]

Review Comment:
   I think we don'nt need this for the inline path (we use the u128 directly)



-- 
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]


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

Reply via email to