HyukjinKwon opened a new pull request, #49134:
URL: https://github.com/apache/arrow/pull/49134

   ### Rationale for this change
   
   SmallVector's move assignment operator had a TODO comment about using 
`assign_by_moving()` optimization. This PR implements it with a sophisticated 
condition that provides 40-90% speedup for small vectors with non-trivial 
types, with no regression for other cases.
   
   ### What changes are included in this PR?
   
   1. Optimized `StaticVectorImpl::operator=(&&)` to conditionally use 
`assign_by_moving()` for static storage + non-trivial types, while keeping fast 
pointer swap for dynamic storage and memcpy for trivial types.
   2. Fixed bug in `move_construct()` where `data_` pointer wasn't reset when 
transitioning from dynamic to static storage.
   
   ### Are these changes tested?
   
   Yes. I manually created benchmark showing 40-90% improvement for static 
storage with no regression elsewhere.
   
   ### Are there any user-facing changes?
   
   No.


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