You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "Yicong-Huang (via GitHub)" <gi...@apache.org> on 2026/04/13 03:09:34 UTC

[PR] [SPARK-56424][PYTHON] Add ASV benchmark for SQL_SCALAR_PANDAS_UDF [spark]

Yicong-Huang opened a new pull request, #55316:
URL: https://github.com/apache/spark/pull/55316

   ### What changes were proposed in this pull request?
   
   Add ASV microbenchmarks for `SQL_SCALAR_PANDAS_UDF` eval type in `bench_eval_type.py`.
   
   The new `_ScalarPandasBenchMixin` follows the same pattern as the existing `_ScalarArrowBenchMixin` but uses Pandas Series operations. It measures the full Arrow-to-Pandas-to-Arrow round-trip that occurs in scalar Pandas UDFs.
   
   **Scenarios** (9): `sm_batch_few_col`, `sm_batch_many_col`, `lg_batch_few_col`, `lg_batch_many_col`, `pure_ints`, `pure_floats`, `pure_strings`, `pure_ts`, `mixed_types`
   
   **UDFs** (3): `identity_udf` (passthrough), `sort_udf` (Series.sort_values), `nullcheck_udf` (Series.notna)
   
   **Benchmark classes** (2): `ScalarPandasUDFTimeBench`, `ScalarPandasUDFPeakmemBench`
   
   ### Why are the changes needed?
   
   This is part of the PySpark Serializer & EvalType Refactor effort (SPARK-55724). We need baseline benchmarks for every eval type before refactoring the serialization path, so we can detect performance regressions. `SQL_SCALAR_PANDAS_UDF` is one of the most commonly used eval types and its Arrow-to-Pandas-to-Arrow conversion cost is a key metric for the refactor.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Ran all 54 benchmarks (27 time + 27 peakmem) locally with `python/asv run --python=same --quick`:
   
   ```
   time_worker results (27/27 passed):
     sm_batch_few_col   identity_udf: 269ms, sort_udf: 385ms, nullcheck_udf: 300ms
     lg_batch_few_col   identity_udf: 836ms, sort_udf: 1.06s, nullcheck_udf: 834ms
     pure_ints          identity_udf: 165ms, sort_udf: 236ms, nullcheck_udf: 170ms
     pure_strings       identity_udf: 819ms, sort_udf: 1.17s, nullcheck_udf: 818ms
     mixed_types        identity_udf: 504ms, sort_udf: 551ms, nullcheck_udf: 510ms
     (+ 12 more scenarios all passing)
   
   peakmem_worker results (27/27 passed):
     Range: 479M - 628M across all scenario/udf combinations
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-56424][PYTHON][TESTS] Add ASV benchmark for SQL_SCALAR_PANDAS_UDF [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #55316:
URL: https://github.com/apache/spark/pull/55316#issuecomment-4248346394

   let's reuse the `[TESTS]` flag for benchmark PRs


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-56424][PYTHON][TESTS] Add ASV benchmark for SQL_SCALAR_PANDAS_UDF [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #55316: [SPARK-56424][PYTHON][TESTS] Add ASV benchmark for SQL_SCALAR_PANDAS_UDF
URL: https://github.com/apache/spark/pull/55316


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-56424][PYTHON][TESTS] Add ASV benchmark for SQL_SCALAR_PANDAS_UDF [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #55316:
URL: https://github.com/apache/spark/pull/55316#issuecomment-4248359254

   merged to master


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org