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

   > This PR was created by an LLM as a draft PR. I will mark it as ready for 
review after human review.
   
   
   ## Which issue does this PR close?
   
   N/A — autonomous exploratory PR.
   
   ## Rationale for this change
   
   Replaced to_hex's one-nibble-per-iteration digit loop with a 256-entry byte 
lookup table (two nibbles/iteration), halving loop iterations for long integers 
with bit-identical output.
   
   ## What changes are included in this PR?
   
   Replaced to_hex's one-nibble-per-iteration digit loop with a 256-entry byte 
lookup table (two nibbles/iteration), halving loop iterations for long integers 
with bit-identical output.
   
   ## Are these changes tested?
   
   Correctness: unit tests + seeded differential fuzz (bit-identical Arrow 
output vs `main`).
   
   Benchmark (criterion):
   
   - i64_random: 8.38% faster (base 47310ns -> cand 43345ns)
   - i64_large_values: 4.001% faster (base 43269ns -> cand 41538ns)
   - i32_random: -1.079% faster (base 45437ns -> cand 45927ns)
   - to_hex_scalar_i32: 4.416% faster (base 76ns -> cand 73ns)
   - i64_random: 8.699% faster (base 23722ns -> cand 21658ns)
   - i64_large_values: 9.138% faster (base 21641ns -> cand 19664ns)
   - i32_random: -0.082% faster (base 22366ns -> cand 22384ns)
   - i64_random: 8.271% faster (base 5887ns -> cand 5400ns)
   - i64_large_values: 8.548% faster (base 5447ns -> cand 4981ns)
   - i32_random: 0.754% faster (base 5578ns -> cand 5536ns)
   - to_hex_scalar_i64: -1.667% faster (base 72ns -> cand 73ns)
   
   Full criterion output:
   
   ```text
   to_hex/scalar_i32       time:   [72.464 ns 73.353 ns 74.313 ns]
                           change: [−5.6616% −4.4159% −3.2105%] (p = 0.00 < 
0.05)
                           Performance has improved.
   
   to_hex/scalar_i64       time:   [72.762 ns 73.347 ns 73.979 ns]
                           change: [+0.7597% +1.6671% +2.6207%] (p = 0.00 < 
0.05)
                           Change within noise threshold.
   
   to_hex size=1024/i32_random
                           time:   [5.5219 µs 5.5362 µs 5.5519 µs]
                           change: [−1.1759% −0.7539% −0.3663%] (p = 0.00 < 
0.05)
                           Change within noise threshold.
   to_hex size=1024/i64_random
                           time:   [5.3749 µs 5.4004 µs 5.4284 µs]
                           change: [−8.8588% −8.2708% −7.6124%] (p = 0.00 < 
0.05)
                           Performance has improved.
   to_hex size=1024/i64_large_values
                           time:   [4.9640 µs 4.9815 µs 5.0036 µs]
                           change: [−9.0021% −8.5475% −7.9514%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 1 outliers among 10 measurements (10.00%)
     1 (10.00%) high severe
   
   to_hex size=4096/i32_random
                           time:   [22.341 µs 22.385 µs 22.445 µs]
                           change: [−0.3183% +0.0822% +0.4876%] (p = 0.71 > 
0.05)
                           No change in performance detected.
   Found 1 outliers among 10 measurements (10.00%)
     1 (10.00%) high severe
   to_hex size=4096/i64_random
                           time:   [21.626 µs 21.659 µs 21.690 µs]
                           change: [−9.1614% −8.6986% −8.2679%] (p = 0.00 < 
0.05)
                           Performance has improved.
   to_hex size=4096/i64_large_values
                           time:   [19.600 µs 19.664 µs 19.728 µs]
                           change: [−9.6011% −9.1377% −8.5799%] (p = 0.00 < 
0.05)
                           Performance has improved.
   
   to_hex size=8192/i32_random
                           time:   [45.542 µs 45.927 µs 46.341 µs]
                           change: [−0.1168% +1.0792% +2.3694%] (p = 0.13 > 
0.05)
                           No change in performance detected.
   Found 1 outliers among 10 measurements (10.00%)
     1 (10.00%) high mild
   to_hex size=8192/i64_random
                           time:   [43.248 µs 43.345 µs 43.454 µs]
                           change: [−9.0189% −8.3801% −7.8411%] (p = 0.00 < 
0.05)
                           Performance has improved.
   to_hex size=8192/i64_large_values
                           time:   [40.705 µs 41.539 µs 42.339 µs]
                           change: [−6.1190% −4.0005% −2.0172%] (p = 0.00 < 
0.05)
                           Performance has improved.
   ```
   
   
   ## Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be 
updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api 
change` label.
   -->
   


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