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

SparseVector.apply performance optimization

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4.3, 3.0.0
    • 2.4.4, 3.0.0
    • ML
    • 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

        Issue Links

          Activity

            People

              podongfeng zhengruifeng
              podongfeng zhengruifeng
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: