gengliangwang opened a new pull request, #57049:
URL: https://github.com/apache/spark/pull/57049

   ### What changes were proposed in this pull request?
   
   Drop the `compile time (ms)` metric from `WholeStageCodegenSizeBenchmark` 
(added in SPARK-57915),
   and regenerate its results file. This removes the metric's docstring bullet, 
the
   `CodeGenerator.resetCompileTime()` / `compileTime` measurement, the reported 
row, and the
   now-unused `CodeGenerator` import.
   
   ### Why are the changes needed?
   
   The compile-time number is not a reliable or reproducible metric, so it can 
mislead when comparing
   before/after:
   
   - `CodeGenerator.compile` is wrapped in a cache keyed on the generated 
source string, and
     `compileTime` only accrues on cache misses. Across the TPC-DS suite a 
large fraction of stages
     generate identical source (measured: ~2247 stages but only ~1214 distinct 
sources), so the metric
     reflects the time to compile the *distinct* subset -- and that subset 
differs between two versions,
     so the totals are not comparable.
   - The size-bounded cache (`spark.sql.codegen.cache.maxEntries`, default 100) 
evicts and recompiles,
     so the number also depends on eviction order, not just the code.
   - It is wall-clock time and therefore JIT/GC/machine-load sensitive: the 
same tree measured ~10%
     apart across two runs, larger than the differences the benchmark is meant 
to detect.
   
   The remaining metrics (generated source size, summed/max method bytecode, 
inner-class count,
   constant-pool entries) are deterministic and machine-independent, and source 
size is itself a stable
   proxy for compile cost (roughly linear in input), so nothing actionable is 
lost.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No (test-only benchmark).
   
   ### How was this patch tested?
   
   Re-ran `build/sbt "sql/Test/runMain 
org.apache.spark.sql.execution.benchmark.WholeStageCodegenSizeBenchmark"`
   and regenerated 
`sql/core/benchmarks/WholeStageCodegenSizeBenchmark-results.txt` with
   `SPARK_GENERATE_BENCHMARK_FILES=1`; the compile-time row is gone and the 
deterministic metrics are
   unchanged.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8)
   


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