beliefer commented on a change in pull request #28081: [SPARK-31315][SQL][TEST]
SQLQueryTestSuite: Display the total compile time for generated java code
URL: https://github.com/apache/spark/pull/28081#discussion_r401313895
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala
##########
@@ -667,6 +669,13 @@ class SQLQueryTestSuite extends QueryTest with
SharedSparkSession {
// For debugging dump some statistics about how much time was spent in
various optimizer rules
logWarning(RuleExecutor.dumpTimeSpent())
+
+ val codegenInfo =
+ s"""
+ |=== Metrics of Whole Codegen ===
+ |Total compile time: ${CodeGenerator.compileTime.sum.toDouble /
NANOS_PER_SECOND} seconds
Review comment:
At first, I wanted to use` CodegenMetrics.METRIC_COMPILATION_TIME` to do
this. After many experiments, I found that
`CodegenMetrics.METRIC_COMPILATION_TIME` is only effective for a single test
case, and cannot play a role in the whole life cycle of `SQLQueryTestSuite`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]