Skip to content
Snippets Groups Projects
Commit 9a6864d0 authored by Reynold Xin's avatar Reynold Xin
Browse files

Fixed a performance problem in RDD.top and BoundedPriorityQueue (size in...

Fixed a performance problem in RDD.top and BoundedPriorityQueue (size in BoundedPriority was actually traversing the entire queue to calculate the size, resulting in bad performance in insertion).
parent 7a8169be
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,8 @@ class BoundedPriorityQueue[A](maxSize: Int)(implicit ord: Ordering[A])
override def iterator: Iterator[A] = underlying.iterator.asScala
override def size: Int = underlying.size
override def ++=(xs: TraversableOnce[A]): this.type = {
xs.foreach { this += _ }
this
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment