Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-28421

SparseVector.apply performance optimization

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.3, 3.0.0
    • Fix Version/s: 2.4.4, 3.0.0
    • Component/s: ML
    • Labels:
      None

      Description

      Current impl of SparseVector.apply is inefficient:

      on each call,  breeze.linalg.SparseVector & breeze.collection.mutable.SparseArray are created internally, then binary-search is used to search the input position.

       

      This place should be optimized like .ml.SparseMatrix, which directly use binary search, without conversion to breeze.linalg.Matrix.

       

      I tested the performance and found that if we avoid the internal conversions, then a 2.5~5X speed up can be obtained.

        Attachments

          Activity

            People

            • Assignee:
              podongfeng zhengruifeng
              Reporter:
              podongfeng zhengruifeng

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment