You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/04/01 08:43:58 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #28081:
[SPARK-31315][SQL][TEST] SQLQueryTestSuite: Display the total compile time
for generated java code
cloud-fan 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_r401450611
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
##########
@@ -1466,10 +1473,12 @@ object CodeGenerator extends Logging {
val startTime = System.nanoTime()
val result = doCompile(code)
val endTime = System.nanoTime()
- def timeMs: Double = (endTime - startTime).toDouble / NANOS_PER_MILLIS
+ val duration = endTime - startTime
+ val timeMs: Double = duration.toDouble / NANOS_PER_MILLIS
CodegenMetrics.METRIC_SOURCE_CODE_SIZE.update(code.body.length)
CodegenMetrics.METRIC_COMPILATION_TIME.update(timeMs.toLong)
logInfo(s"Code generated in $timeMs ms")
+ _compileTime.add(duration)
Review comment:
I think `timeMs` is good enough to be recorded.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org