Skip to content

[SPARK-56244][PYTHON][TEST][FOLLOWUP] Lazy scenario building for accurate peakmem benchmarks#55059

Closed
Yicong-Huang wants to merge 1 commit intoapache:masterfrom
Yicong-Huang:SPARK-56244/followup/peakmem-gc
Closed

[SPARK-56244][PYTHON][TEST][FOLLOWUP] Lazy scenario building for accurate peakmem benchmarks#55059
Yicong-Huang wants to merge 1 commit intoapache:masterfrom
Yicong-Huang:SPARK-56244/followup/peakmem-gc

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

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's peakmem only 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.

@Yicong-Huang Yicong-Huang force-pushed the SPARK-56244/followup/peakmem-gc branch from 3e1f517 to 100bd83 Compare March 27, 2026 10:53
@zhengruifeng
Copy link
Copy Markdown
Contributor

merged to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants