[SPARK-58067][PYTHON][TESTS] Add ASV microbenchmark for SQL_TRANSFORM_WITH_STATE_PYTHON_ROW_INIT_STATE_UDF#57167
Open
Yicong-Huang wants to merge 2 commits into
Open
[SPARK-58067][PYTHON][TESTS] Add ASV microbenchmark for SQL_TRANSFORM_WITH_STATE_PYTHON_ROW_INIT_STATE_UDF#57167Yicong-Huang wants to merge 2 commits into
Yicong-Huang wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Add an ASV microbenchmark for the
SQL_TRANSFORM_WITH_STATE_PYTHON_ROW_INIT_STATE_UDFeval type (served byTransformWithStateInPySparkRowInitStateSerializer), mirroring the existingSQL_TRANSFORM_WITH_STATE_PANDAS_INIT_STATE_UDFbenchmark and the non-init Row benchmark (#57047). It reuses the existingbench_eval_type.pyharness and the plain-Row scenario grid from_TransformWithStateRowBenchMixin, addingTransformWithStateRowInitStateUDF{Time,Peakmem}Benchover 7 scenarios x 3 UDFs. The UDF signature is(api_client, mode, key, rows, init_rows)where bothrowsandinit_rowsare iterators ofRow. The input wire stream is the nestedstruct<inputData, initState>Arrow stream (init batches first, then data batches); the serializer materializes every column into aRowvia.as_py()and regroups by the leading key, so each key surfaces as one init-only call followed by one data-only call -- the per-row Python object path this eval type is built around, layered on the init-state deserialization.Stacked on #57047 (
_TransformWithStateRowBenchMixin); will rebase onto master once that merges.Why are the changes needed?
Establishes a no-regression baseline for the upcoming refactor that moves the Row init-state transformWithState logic out of the serializer into
read_udfs().Does this PR introduce any user-facing change?
No.
How was this patch tested?
Benchmark-only change. Ran
asv run --bench 'TransformWithStateRowInitState' -a repeat=3 --python=sametwice; results were stable across runs (time within ~2%, peakmem identical). One representative run:Was this patch authored or co-authored using generative AI tooling?
No.