@@ -56,6 +56,9 @@ class EdgePartition[@specialized(Char, Int, Boolean, Byte, Long, Float, Double)
56
56
* Construct a new edge partition by applying the function f to all
57
57
* edges in this partition.
58
58
*
59
+ * Be careful not to keep references to the objects passed to `f`.
60
+ * To improve GC performance the same object is re-used for each call.
61
+ *
59
62
* @param f a function from an edge to a new attribute
60
63
* @tparam ED2 the type of the new attribute
61
64
* @return a new edge partition with the result of the function `f`
@@ -182,6 +185,9 @@ class EdgePartition[@specialized(Char, Int, Boolean, Byte, Long, Float, Double)
182
185
/**
183
186
* Get an iterator over the edges in this partition.
184
187
*
188
+ * Be careful not to keep references to the objects from this iterator.
189
+ * To improve GC performance the same object is re-used in `next()`.
190
+ *
185
191
* @return an iterator over edges in the partition
186
192
*/
187
193
def iterator = new Iterator [Edge [ED ]] {
@@ -210,6 +216,9 @@ class EdgePartition[@specialized(Char, Int, Boolean, Byte, Long, Float, Double)
210
216
/**
211
217
* Get an iterator over the cluster of edges in this partition with source vertex id `srcId`. The
212
218
* cluster must start at position `index`.
219
+ *
220
+ * Be careful not to keep references to the objects from this iterator. To improve GC performance
221
+ * the same object is re-used in `next()`.
213
222
*/
214
223
private def clusterIterator (srcId : VertexId , index : Int ) = new Iterator [Edge [ED ]] {
215
224
private [this ] val edge = new Edge [ED ]
0 commit comments