You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by hhbyyh <gi...@git.apache.org> on 2015/12/04 15:48:46 UTC

[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

GitHub user hhbyyh opened a pull request:

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

    [SPARK-12026] [MLlib] ChiSqTest gets slower and slower over time when number of features is large

    jira: https://issues.apache.org/jira/browse/SPARK-12026
    
    The issue is valid as features.toArray.view.zipWithIndex.slice(startCol, endCol) becomes slower as startCol gets larger.
    
    I tested on local and the change can improve the performance and the running time was stable.

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

    $ git pull https://github.com/hhbyyh/spark chiSq

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

    https://github.com/apache/spark/pull/10146.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 #10146
    
----
commit 1b1a0c6c92fc94bc31b8060e1b1f834db20c9d21
Author: Yuhao Yang <hh...@gmail.com>
Date:   2015-12-04T14:36:47Z

    avoid view

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by hhbyyh <gi...@git.apache.org>.
Github user hhbyyh commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-171499664
  
    @thunterdb Thanks a lot for the recommendation. I'll try with it. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-162569175
  
    lgtm


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-170777710
  
    **[Test build #2365 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2365/consoleFull)** for PR 10146 at commit [`a709f49`](https://github.com/apache/spark/commit/a709f49a751aa07ccbefdd6a44a5c1afa4b57f35).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-171498026
  
    LGTM
    Merging with master and branch-1.6


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by hhbyyh <gi...@git.apache.org>.
Github user hhbyyh commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10146#discussion_r46748950
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/stat/test/ChiSqTest.scala ---
    @@ -109,9 +109,10 @@ private[stat] object ChiSqTest extends Logging {
               }
               i += 1
               distinctLabels += label
    -          features.toArray.view.zipWithIndex.slice(startCol, endCol).map { case (feature, col) =>
    -            allDistinctFeatures(col) += feature
    -            (col, feature, label)
    +          features.toArray.slice(startCol, endCol).zip(startCol until endCol).map {
    --- End diff --
    
    Thanks @squito for the great suggestion. I would wait for a while to see if there're other comments. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-162476627
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/47263/
    Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by hhbyyh <gi...@git.apache.org>.
Github user hhbyyh commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-170765819
  
     Failed to fetch from https://github.com/apache/spark.git.
    need a retest


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-170770236
  
    @hhbyyh Thanks for doing that test.  Let's go with option 3 as you suggested.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by thunterdb <gi...@git.apache.org>.
Github user thunterdb commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-170949938
  
    @hhbyyh yes, option 3 sounds good.
    
    A caveat, though, about the numbers you posted: micro benchmarks on the JVM are very hard to get right, and a simple loop is not considered a good practice in general. I recommend you use a framework like JMH. There are some scala wrappers for it.
    http://openjdk.java.net/projects/code-tools/jmh/


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-170762436
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/49200/
    Test FAILed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by thunterdb <gi...@git.apache.org>.
Github user thunterdb commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10146#discussion_r48805286
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/stat/test/ChiSqTest.scala ---
    @@ -109,7 +109,9 @@ private[stat] object ChiSqTest extends Logging {
               }
               i += 1
               distinctLabels += label
    -          features.toArray.view.zipWithIndex.slice(startCol, endCol).map { case (feature, col) =>
    +          val featureArray = features.toArray
    +          (startCol until endCol).map { col =>
    +            val feature = featureArray(col)
    --- End diff --
    
    ah yes, good catch about the view that builds incrementally a copy of the feature vectors.
    
    Let's also remove the `featureArray`, we can call directly `val feature = features(col)`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10146#discussion_r46708243
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/stat/test/ChiSqTest.scala ---
    @@ -109,9 +109,10 @@ private[stat] object ChiSqTest extends Logging {
               }
               i += 1
               distinctLabels += label
    -          features.toArray.view.zipWithIndex.slice(startCol, endCol).map { case (feature, col) =>
    -            allDistinctFeatures(col) += feature
    -            (col, feature, label)
    +          features.toArray.slice(startCol, endCol).zip(startCol until endCol).map {
    --- End diff --
    
    `slice` is going to make a copy, and then `zip` will make another one.  If the goal is to improve performance, I think it makes the most sense to iterate over the range you want directly:
    
    ```scala
    val arr = features.toArray
    (startCol until endCol).map { col =>
      val feaure = arr(col)
      allDistinctFeatures(col) += feature
      (col, feature, label)
    }
    ```
    
    or even go a step further and pre-allocate the result array, to avoid all the copying from dynamically growing it.
    
    also `toArray` is going to  be horrible on sparse vectors -- it might make more sense to use `toBreeze`, which won't create so much wasted space (though still suboptimal looping).  Better would be special handling.  But that is independent from the main issue here.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by hhbyyh <gi...@git.apache.org>.
Github user hhbyyh commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10146#discussion_r49408306
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/stat/test/ChiSqTest.scala ---
    @@ -109,7 +109,9 @@ private[stat] object ChiSqTest extends Logging {
               }
               i += 1
               distinctLabels += label
    -          features.toArray.view.zipWithIndex.slice(startCol, endCol).map { case (feature, col) =>
    +          val featureArray = features.toArray
    +          (startCol until endCol).map { col =>
    +            val feature = featureArray(col)
    --- End diff --
    
    @jkbradley I changed it to invoking toBreeze directly. I ran some test on local.
    
    ```
        val sv = new SparseVector(100000, Array(1), Array(2.5))
        var t = 0.0
    
        {
          val ts = System.nanoTime()
          val arr = sv.toArray
          for(i <- 0 to 10000){
            t = arr(i)
          }
          println(System.nanoTime() - ts)
        }
    
        {
          val ts = System.nanoTime()
          for(i <- 0 to 10000){
            t = sv(i)
          }
          println(System.nanoTime() - ts)
        }
    
        {
          val ts = System.nanoTime()
          val brz = sv.toBreeze
          for(i <- 0 to 10000){
            t = brz(i)
          }
          println(System.nanoTime() - ts)
        }
    ```
    
    gives 
    3405342
    520367839
    4870954
    
    Let me know how do you think of it.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-162000277
  
    Merged build finished. Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by hhbyyh <gi...@git.apache.org>.
Github user hhbyyh commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10146#discussion_r49298652
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/stat/test/ChiSqTest.scala ---
    @@ -109,7 +109,9 @@ private[stat] object ChiSqTest extends Logging {
               }
               i += 1
               distinctLabels += label
    -          features.toArray.view.zipWithIndex.slice(startCol, endCol).map { case (feature, col) =>
    +          val featureArray = features.toArray
    +          (startCol until endCol).map { col =>
    +            val feature = featureArray(col)
    --- End diff --
    
    @thunterdb @jkbradley Thanks for the comment. Please correct if I'm wrong. For sparse vector, I'm afraid `features(col)` will not be efficient given the current implementation of `SparseVector`.
    `  def apply(i: Int): Double = toBreeze(i)`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10146#discussion_r49235733
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/stat/test/ChiSqTest.scala ---
    @@ -109,7 +109,9 @@ private[stat] object ChiSqTest extends Logging {
               }
               i += 1
               distinctLabels += label
    -          features.toArray.view.zipWithIndex.slice(startCol, endCol).map { case (feature, col) =>
    +          val featureArray = features.toArray
    +          (startCol until endCol).map { col =>
    +            val feature = featureArray(col)
    --- End diff --
    
    +1 since that could avoid a copy


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-162000278
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/47199/
    Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-170770224
  
    **[Test build #2365 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2365/consoleFull)** for PR 10146 at commit [`a709f49`](https://github.com/apache/spark/commit/a709f49a751aa07ccbefdd6a44a5c1afa4b57f35).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-161987769
  
    **[Test build #47199 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/47199/consoleFull)** for PR 10146 at commit [`1b1a0c6`](https://github.com/apache/spark/commit/1b1a0c6c92fc94bc31b8060e1b1f834db20c9d21).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10146#discussion_r49392781
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/stat/test/ChiSqTest.scala ---
    @@ -109,7 +109,9 @@ private[stat] object ChiSqTest extends Logging {
               }
               i += 1
               distinctLabels += label
    -          features.toArray.view.zipWithIndex.slice(startCol, endCol).map { case (feature, col) =>
    +          val featureArray = features.toArray
    +          (startCol until endCol).map { col =>
    +            val feature = featureArray(col)
    --- End diff --
    
    Converting to Breeze should be an O(1) operation, using a reference copy, not a deep copy.  Breeze uses binary search on the indices, so it should be fairly efficient.  I think it's better than converting to a dense array.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-170762432
  
    Merged build finished. Test FAILed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-162465080
  
    **[Test build #47263 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/47263/consoleFull)** for PR 10146 at commit [`8d8327d`](https://github.com/apache/spark/commit/8d8327d7f828ed865a103509f361292a69402129).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by thunterdb <gi...@git.apache.org>.
Github user thunterdb commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-168867750
  
    @hhbyyh thanks for the fix; I just have one small comment.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-162476502
  
    **[Test build #47263 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/47263/consoleFull)** for PR 10146 at commit [`8d8327d`](https://github.com/apache/spark/commit/8d8327d7f828ed865a103509f361292a69402129).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-162476626
  
    Merged build finished. Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by hhbyyh <gi...@git.apache.org>.
Github user hhbyyh commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-170760561
  
    @jkbradley I changed it to invoking toBreeze directly. I ran some test on local.
    
        val sv = new SparseVector(100000, Array(1), Array(2.5))
        var t = 0.0
    
        {
          val ts = System.nanoTime()
          val arr = sv.toArray
          for(i <- 0 to 10000){
            t = arr(i)
          }
          println(System.nanoTime() - ts)
        }
    
        {
          val ts = System.nanoTime()
          for(i <- 0 to 10000){
            t = sv(i)
          }
          println(System.nanoTime() - ts)
        }
    
        {
          val ts = System.nanoTime()
          val brz = sv.toBreeze
          for(i <- 0 to 10000){
            t = brz(i)
          }
          println(System.nanoTime() - ts)
        }
    gives 
    3405342
    520367839
    4870954
    
    Let me know how do you think of it.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-12026] [MLlib] ChiSqTest gets slower an...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/10146#issuecomment-162000085
  
    **[Test build #47199 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/47199/consoleFull)** for PR 10146 at commit [`1b1a0c6`](https://github.com/apache/spark/commit/1b1a0c6c92fc94bc31b8060e1b1f834db20c9d21).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org