CuteChuanChuan opened a new pull request, #20807:
URL: https://github.com/apache/datafusion/pull/20807

   ## Which issue does this PR close?
   - Closes #20054 .
   
   ## Rationale for this change
   `ArrowBytesViewMap::insert_if_new_inner` calls `values.value(i)` redundantly:
   1. Inside the `find` closure
   2. Again during insertion when the value is new
   
   For inline strings (<=12 bytes), `values.value(i)` is unnecessary since the 
data is embedded directly in the view. 
   For non-inline strings (>12 bytes), it should only be called once.
   
   ## What changes are included in this PR?
   - **Inline strings (<=12 bytes):** Extract bytes directly instead of calling 
`values.value(i)`. During insertion, push the original `view_u128` directly.
   - **Non-inline strings (>12 bytes):** Fetch `values.value(i)` once before 
the `find` closure and reuse the result for both hash collision resolution and 
insertion.
   
   ## Are these changes tested?
   Yes, covered by existing tests by runningé‚£ `cargo test -p 
datafusion-physical-expr-common`
   
   ## Are there any user-facing changes?
   No. This is an internal performance optimization with no API changes.
   


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