Github user JoshRosen commented on a diff in the pull request: https://github.com/apache/spark/pull/16989#discussion_r117174976 --- Diff: core/src/main/scala/org/apache/spark/scheduler/MapStatus.scala --- @@ -193,8 +217,19 @@ private[spark] object HighlyCompressedMapStatus { } else { 0 } + val threshold = SparkEnv.get.conf.get(config.SHUFFLE_ACCURATE_BLOCK_THRESHOLD) + val hugeBlockSizesArray = ArrayBuffer[Tuple2[Int, Byte]]() + if (numNonEmptyBlocks > 0) { + uncompressedSizes.zipWithIndex.foreach { --- End diff -- The existing code tried to optimize for performance by using an imperative while loop instead of Scala collections operations. Thus I don't think we should be using `zipWithIndex` and `foreach` here. In addition, it would be better to do this during a single loop rather than two loops.
--- 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