neilconway commented on PR #11219:
URL: https://github.com/apache/arrow-rs/pull/11219#issuecomment-5890736450

   @Jefffrey I asked Claude to investigate this:
   
   ===
   - The per-element loop is identical. All 35 kernels for the pairs #10958 
covers compile to the same instructions in both PRs, on aarch64, x86-64 and 
x86-64-v3 (only data addresses differ). None of our 48 fast-path kernels keeps 
a panic path for the expect.
   - Outside the loop there's one real difference. #10958's type check itself 
compiles away, but it leaves two calls that clean up temporary DataType values 
in every numeric cast, including the 75 pairs it doesn't speed up. On 1-row 
arrays that costs 1.2–2.1 ns per cast() call, consistently. At 512+ rows it's 
lost in the noise. Our version has no such calls.
   
   ```
   
┌────────────────────────────────────┬─────────────────┬──────────────────┬────────────────────┐
   │                                    │ 512 rows (safe) │ 8192 rows (safe) │ 
8192 rows (unsafe) │
   
├────────────────────────────────────┼─────────────────┼──────────────────┼────────────────────┤
   │ Speedup vs main: ours              │           4.33x │            8.20x │  
            8.16x │
   
├────────────────────────────────────┼─────────────────┼──────────────────┼────────────────────┤
   │ Speedup vs main: #10958            │           4.29x │            8.30x │  
            8.25x │
   
├────────────────────────────────────┼─────────────────┼──────────────────┼────────────────────┤
   │ Ours / #10958 (geometric mean)     │           0.991 │            1.012 │  
            1.011 │
   
└────────────────────────────────────┴─────────────────┴──────────────────┴────────────────────┘
   ```
   ===
   
   So for the cases covered by both PRs, performance is basically equivalent.


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