GitHub user rxin opened a pull request: https://github.com/apache/spark/pull/229
Use Guava's top k implementation rather than our BoundedPriorityQueue based implementation Also updated the documentation for top and takeOrdered. On my simple test of sorting 100 million (Int, Int) tuples using Spark, Guava's top k implementation (in Ordering) is much faster than the BoundedPriorityQueue implementation for roughly sorted input (10 - 20X faster), and still faster for purely random input (2 - 5X). You can merge this pull request into a Git repository by running: $ git pull https://github.com/rxin/spark takeOrdered Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/229.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #229 ---- commit a1da19d69d3f6eecf6c57ef0e32267fe5bd02096 Author: Reynold Xin <r...@apache.org> Date: 2014-03-25T21:49:15Z Use Guava's top k implementation rather than our BoundedPriorityQueue based implementation. Also updated the documentation for top and takeOrdered. Guava's top k implementation (in Ordering) is much faster than the BoundedPriorityQueue implementation for roughly sorted input (10 - 20X faster), and still faster for purely random input (2 - 5X). commit 723c29403b3662bb4866669cdf8411a8cf24597b Author: Reynold Xin <r...@apache.org> Date: 2014-03-25T21:56:54Z Doc update. ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---