LuciferYang commented on code in PR #38427:
URL: https://github.com/apache/spark/pull/38427#discussion_r1008675119
##########
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala:
##########
@@ -276,7 +276,7 @@ final class ShuffleBlockFetcherIterator(
val (size, mapIndex) = infoMap(blockId)
FetchBlockInfo(BlockId(blockId), size, mapIndex)
}
- results.put(DeferFetchRequestResult(FetchRequest(address,
blocks.toSeq)))
+ results.put(DeferFetchRequestResult(FetchRequest(address,
blocks.toIndexedSeq)))
Review Comment:
When using Scala 2.12, `blocks.toSeq` is a redundant operation, which will
not cause any memory copy with Scala 2.12 . However, `blocks.toIndexedSeq` will
cause a memory copy with Scala 2.12. This change may be beneficial to Scala
2.13, but it will harm the performance of Scala 2.12.
The current default version is still Scala 2.12, so I suggest leave this
line as it is and add some TODOs to facilitate change when Scala 2.13 is the
default version
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]