You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to alge...@googlegroups.com
In PriorityQueueMonoid there is a build method that takes an iterable: def build(items: Iterable[K]): PriorityQueue[K]
Inside this method it creates the like this: val q = new PriorityQueue(items.size max MINQUEUESIZE, ord.reverse);
Why base the size of the queue on the size of items if the queue can only grow to size max (or technically size max + 1 since it can first add one item before limiting it's size to max)? If i have a very large iterable this leads to allocation a lot of memory for the queue which doesn't seem necessary to me.
Also if the queue was allocated like this val q = new PriorityQueue(max + 1, ord.reverse); then we could take an iterator instead of an iterable...