GitHub user hhbyyh reopened a pull request: https://github.com/apache/spark/pull/3997
[SPARK-5186] [MLLIB] Vector.equals and Vector.hashCode are very inefficient JIRA Issue: https://issues.apache.org/jira/browse/SPARK-5186 Currently SparseVector is using the inherited equals from Vector, which will create a full-size array for even the sparse vector. The pull request contains a specialized equals optimization that improves on both time and space. 1. The implementation will be consistent with the original. Especially it will keep equality comparison between SparseVector and DenseVector. 2. For the hash code, overriding it may generate some breaking change and we should do it in another PR. You can merge this pull request into a Git repository by running: $ git pull https://github.com/hhbyyh/spark master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/3997.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 #3997 ---- commit 574114433222f4adb95e1e98f5d96e72e733eb4d Author: Yuhao Yang <yu...@yuhaodevbox.sh.intel.com> Date: 2015-01-13T04:31:13Z Specialized equals for SparseVector commit f41b135ab0394e881bd03c87bb02aa77be61fb64 Author: Yuhao Yang <hhb...@gmail.com> Date: 2015-01-16T15:13:12Z iterative equals for sparse vector commit 50abef35ef4ccb4f4f037bb7d29c5200cc7ab7cb Author: Yuhao Yang <hhb...@gmail.com> Date: 2015-01-16T15:47:19Z fix ut for sparse vector with explicit 0 ---- --- 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. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org