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

   ### Rationale for this change
   
   The TODO comment in `SmallVector`'s move assignment operator asks whether to 
use `assign_by_moving()` instead of `destroy() + move_construct()`.  However, 
using `destroy() + move_construct()` is faster in most of the cases by `memcpy` 
according to the benchmark I ran:
   
   | Type | Elements | destroy + move_construct | assign_by_moving |
   
|------|----------|-----------------------------------|----------------------|
   | `uint8_t*` | 16 | 3.54 ns | 8.71 ns |
   | `const uint8_t*` | 16 | 3.54 ns | 8.71 ns |
   | `const void*` | 3 | 1.49 ns | 5.00 ns |
   | `int` | 2 | 1.38 ns | 5.52 ns | 4.00x slower |
   | `std::string_view` | 2 | 8.42 ns | 3.78 ns |
   | `std::pair<int64_t, int64_t>` | 1 | 1.40 ns | 2.16 ns |
   | `FakeArrowStruct` | 4 | 3.54 ns | 6.32 ns |
   
   (I did not include the benchmark I ran to make the pr description shorter. 
Can be provided upon request)
   
   We could sophisticatedly benchmark, design and consider other cases but I 
believe this is not worthwhile.
   
   ### What changes are included in this PR?
   
   Removed the TODO comment.
   
   ### Are these changes tested?
   
   No I did not test.
   
   ### 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