[SPARK-56244][PYTHON][TEST][FOLLOWUP] Lazy scenario building for accurate peakmem benchmarks#55059
Closed
Yicong-Huang wants to merge 1 commit intoapache:masterfrom
Closed
Conversation
3e1f517 to
100bd83
Compare
100bd83 to
f6b32f2
Compare
zhengruifeng
approved these changes
Mar 30, 2026
Contributor
|
merged to master |
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?
Refactor all benchmark mixin classes to build scenario data lazily instead of eagerly at import time. Also consolidate duplicated type pool definitions into
MockDataFactory.NAMED_TYPE_POOLS.Why are the changes needed?
Follow-up to #55040. The eager
_scenarios = _build_scenarios()pattern pre-built all scenario data at class definition time, inflating peak RSS. Since ASV'speakmemonly increases and never decreases, all scenarios showed the same inflated reading regardless of actual benchmark memory usage.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Ran all existing ASV benchmarks via
python/asv run. Time results are consistent with the eager version; peakmem now shows per-scenario differentiation instead of a single inflated value.Was this patch authored or co-authored using generative AI tooling?
No.