GitHub user rogermenezes opened a pull request:

    https://github.com/apache/spark/pull/6768

    [SPARK-8314][MLlib] improvement in performance of MLUtils.appendBias

    MLUtils.appendBias method is heavily used in creating intercepts for linear 
models. 
    This method uses Breeze's vector concatenation which is very slow compared 
to the plain 
    System.arrayCopy. This improvement is to change the implementation to use 
System.arrayCopy.
    
    I saw the following performance improvements after the change:
    Benchmark with mnist dataset for 50 times:
    MLUtils.appendBias (SparseVector Before): 47320 ms
    MLUtils.appendBias (SparseVector After): 1935 ms
    MLUtils.appendBias (DenseVector Before): 5340 ms
    MLUtils.appendBias (DenseVector After): 4080 ms
    This is almost a 24 times performance boost for SparseVectors.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rogermenezes/spark improve-append-bias

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/6768.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 #6768
    
----
commit e999d79ad76426614cc7a2db65a068ed402d0216
Author: Roger Menezes <[email protected]>
Date:   2015-06-11T22:37:37Z

    first commit

----


---
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]

Reply via email to