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

   > 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 four builder-based row-by-row loops with a single generic kernel 
that reads operands from the raw value slices and unions the null buffers once, 
removing the per-element null probes and PrimitiveBuilder null-buffer appends 
from the hot loop.
   
   ## What changes are included in this PR?
   
   Replaced four builder-based row-by-row loops with a single generic kernel 
that reads operands from the raw value slices and unions the null buffers once, 
removing the per-element null probes and PrimitiveBuilder null-buffer appends 
from the hot loop.
   
   ## How are these changes tested?
   
   Correctness: unit tests + seeded differential fuzz (bit-identical Arrow 
output vs `main`).
   
   Benchmark (criterion):
   
   - checked_sub_i64_ansi_with_nulls: 68.147% faster (base 18814ns -> cand 
5992ns)
   - checked_sub_i64_ansi_no_nulls: 61.969% faster (base 12122ns -> cand 4610ns)
   - checked_div_f64_ansi_with_nulls: 70.188% faster (base 19442ns -> cand 
5796ns)
   - checked_add_i32_ansi_no_nulls: 70.466% faster (base 11532ns -> cand 3405ns)
   - checked_add_i32_ansi_with_nulls: 74.668% faster (base 19018ns -> cand 
4817ns)
   - checked_mul_i64_ansi_with_nulls: 62.761% faster (base 18956ns -> cand 
7059ns)
   - checked_add_i32_try_with_nulls: 39.008% faster (base 18674ns -> cand 
11389ns)
   - checked_add_i32_try_no_nulls: 26.572% faster (base 5111ns -> cand 3753ns)
   - checked_div_f64_ansi_no_nulls: 78.247% faster (base 15097ns -> cand 3284ns)
   - checked_mul_i64_ansi_no_nulls: 53.602% faster (base 11030ns -> cand 5117ns)
   
   Full criterion output:
   
   ```text
   checked_arithmetic/checked_add_i32_ansi_no_nulls
                           time:   [3.3873 µs 3.3965 µs 3.4073 µs]
                           change: [−70.767% −70.466% −70.257%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 1 outliers among 100 measurements (1.00%)
     1 (1.00%) high mild
   checked_arithmetic/checked_add_i32_try_no_nulls
                           time:   [3.7449 µs 3.7522 µs 3.7602 µs]
                           change: [−27.302% −26.572% −25.955%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 12 outliers among 100 measurements (12.00%)
     7 (7.00%) high mild
     5 (5.00%) high severe
   checked_arithmetic/checked_sub_i64_ansi_no_nulls
                           time:   [4.6115 µs 4.6161 µs 4.6215 µs]
                           change: [−62.733% −61.969% −61.301%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 10 outliers among 100 measurements (10.00%)
     5 (5.00%) low mild
     4 (4.00%) high mild
     1 (1.00%) high severe
   checked_arithmetic/checked_mul_i64_ansi_no_nulls
                           time:   [4.9912 µs 5.0081 µs 5.0288 µs]
                           change: [−54.837% −53.602% −52.449%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 6 outliers among 100 measurements (6.00%)
     1 (1.00%) high mild
     5 (5.00%) high severe
   checked_arithmetic/checked_div_f64_ansi_no_nulls
                           time:   [3.2848 µs 3.2979 µs 3.3125 µs]
                           change: [−78.363% −78.247% −78.135%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 10 outliers among 100 measurements (10.00%)
     6 (6.00%) high mild
     4 (4.00%) high severe
   checked_arithmetic/checked_add_i32_ansi_with_nulls
                           time:   [4.7731 µs 4.7846 µs 4.7987 µs]
                           change: [−74.790% −74.668% −74.551%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 5 outliers among 100 measurements (5.00%)
     5 (5.00%) high mild
   checked_arithmetic/checked_add_i32_try_with_nulls
                           time:   [11.292 µs 11.396 µs 11.507 µs]
                           change: [−39.443% −39.008% −38.567%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 1 outliers among 100 measurements (1.00%)
     1 (1.00%) high mild
   checked_arithmetic/checked_sub_i64_ansi_with_nulls
                           time:   [6.0276 µs 6.0472 µs 6.0646 µs]
                           change: [−68.222% −68.147% −68.067%] (p = 0.00 < 
0.05)
                           Performance has improved.
   checked_arithmetic/checked_mul_i64_ansi_with_nulls
                           time:   [6.9766 µs 6.9971 µs 7.0202 µs]
                           change: [−62.881% −62.761% −62.647%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 3 outliers among 100 measurements (3.00%)
     3 (3.00%) high mild
   checked_arithmetic/checked_div_f64_ansi_with_nulls
                           time:   [5.7559 µs 5.7662 µs 5.7790 µs]
                           change: [−70.608% −70.188% −69.860%] (p = 0.00 < 
0.05)
                           Performance has improved.
   ```
   
   
   


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