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

   ## Which issue does this PR close?
   
   Part of #5112.
   
   ## Rationale for this change
   
   #5112 shows that `CometNativeColumnarToRowExec` is 3.7x slower per row than 
the JVM implementation at the default batch size and up to 15.7x slower on 
small batches, yet `CometColumnarToRowBenchmark` reports parity in every group. 
The existing benchmark measures end-to-end parquet queries with a `noop()` 
sink, so the scan cost (70 to 530 ns/row) swamps the conversion cost and every 
batch arrives at the full 8192 rows, which amortizes the native path's roughly 
10us of fixed per-batch overhead. This PR adds benchmarks that can actually 
observe conversion cost so that regressions in this class are visible and 
future improvements can be measured.
   
   ## What changes are included in this PR?
   
   - New `CometC2RIsolatedBench`: measures columnar-to-row conversion in 
isolation on in-memory Arrow batches, comparing the JVM `rowIterator` plus 
`UnsafeProjection` path against `NativeColumnarToRowConverter` at batch sizes 
8192, 512, and 32. Numbers from an Apple M3 Ultra are in #5112.
   - Two new groups in `CometColumnarToRowBenchmark`:
     - dictionary-encoded parquet strings (the session default disables 
dictionary encoding, but real-world parquet data is usually dictionary-encoded)
     - a Scala UDF consumer, which defeats escape analysis and exercises the 
whole-stage codegen fusion asymmetry between the `CodegenSupport` JVM operator 
and the iterator-based native operator
   - Disable ANSI mode in the benchmark session: on Spark 4.x defaults the data 
generation queries fail with `CAST_OVERFLOW` on `cast(id as byte)` at id=128, 
so the benchmark could not run at all against Spark 4.x before this change.
   
   ## How are these changes tested?
   
   These are benchmark additions, exercised by running them:
   
   ```
   make benchmark-org.apache.spark.sql.benchmark.CometColumnarToRowBenchmark
   ```
   
   and `CometC2RIsolatedBench` via `exec:java` on the test classpath. Result 
tables from both are posted in #5112.
   


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