GitHub user hhbyyh opened 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 <[email protected]>
Date: 2015-01-13T04:31:13Z
Specialized equals for SparseVector
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]