Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/18693#discussion_r128632856
--- Diff: graphx/src/main/scala/org/apache/spark/graphx/lib/PageRank.scala
---
@@ -199,10 +199,10 @@ object PageRank extends Logging {
require(sources.max <= Int.MaxValue.toLong,
s"This implementation currently only works for source vertex ids at
most ${Int.MaxValue}")
val zero = Vectors.sparse(sources.size, List()).asBreeze
- val sourcesInitMap = sources.zipWithIndex.map { case (vid, i) =>
+ val sourcesInitMap: Map[VertexId, BV[Double]] =
sources.zipWithIndex.map { case (vid, i) =>
val v = Vectors.sparse(sources.size, Array(i), Array(1.0)).asBreeze
(vid, v)
- }.toMap
+ }(collection.breakOut)
--- End diff --
Ah OK that's what it is. Why is this different? the article you cited isn't
comparing to toMap, and toMap doesn't make an intermediate collection.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]