kiszk commented on a change in pull request #25766: [SPARK-29061][SQL] Prints 
bytecode statistics in debugCodegen
URL: https://github.com/apache/spark/pull/25766#discussion_r324498462
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/debug/package.scala
 ##########
 @@ -81,11 +82,21 @@ package object debug {
   def writeCodegen(append: String => Unit, plan: SparkPlan): Unit = {
     val codegenSeq = codegenStringSeq(plan)
     append(s"Found ${codegenSeq.size} WholeStageCodegen subtrees.\n")
-    for (((subtree, code), i) <- codegenSeq.zipWithIndex) {
-      append(s"== Subtree ${i + 1} / ${codegenSeq.size} ==\n")
+    for (((subtree, code, codeStats), i) <- codegenSeq.zipWithIndex) {
+      val usedConstPoolRatio = if (codeStats.maxConstPoolSize > 0) {
+        val rt = 100.0 * codeStats.maxConstPoolSize / 
CodeGenerator.MAX_JVM_CONSTANT_POOL_SIZE
+        "(%.2f%% used)".format(rt)
+      } else {
+        ""
+      }
+      val codeStatsStr = s"maxClassCodeSize:${codeStats.maxClassCodeSize}; " +
 
 Review comment:
   @maropu Could you elaborate on your idea to add this?
   
   How about adding ratio of `maxMethodCodeSize` / 
`CodeGenerator.DEFAULT_JVM_HUGE_METHOD_LIMIT`, too?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to