Github user srowen commented on a diff in the pull request: https://github.com/apache/spark/pull/14336#discussion_r72023268 --- Diff: mllib/src/main/scala/org/apache/spark/ml/tree/impl/RandomForest.scala --- @@ -118,9 +118,11 @@ private[spark] object RandomForest extends Logging { val splits = findSplits(retaggedInput, metadata, seed) timer.stop("findSplits") logDebug("numBins: feature: number of bins") - logDebug(Range(0, metadata.numFeatures).map { featureIndex => - s"\t$featureIndex\t${metadata.numBins(featureIndex)}" - }.mkString("\n")) + if (log.isDebugEnabled) { + logDebug(Range(0, metadata.numFeatures).map { featureIndex => --- End diff -- If debug logging isn't enabled, it shouldn't even evaluate this though. Try `def lazyLen(doIt: Boolean, msg: => String) = if (doIt) msg.length else -1` and then compare `lazyLen(true, { Thread.sleep(10000); "foo" })` and `lazyLen(false, { Thread.sleep(10000); "foo" })`. In the second case it will return immediately without evaluating the second arg. You're showing Spark stages, but this code doesn't invoke a distributed operation. You may be looking at the wrong thing.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org