Commons Math
  1. Commons Math
  2. MATH-578

Decrease DescriptiveStatistics performance from 2.0 to 2.2

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 3.1
    • Labels:
      None
    • Environment:

      Linux

      Description

      Switching between commons-math 2.0 to 2.2 we note how the
      DescriptiveStatistics.addValue(double) has decrease the performance.

      I tested with 2 million values.

      DescriptiveStatistics ds = new DescriptiveStatistics();
      for(int i = 0; i<1000*1000*2; i++)

      { //2 million values ds.addValue(v); }

      ds.getPercentile(50);

      Seems that depending by the values inserted in the DescriptiveStatistics it takes different time:

      • with a single value (0)
        • 2.0 -> take ~500 ms
        • 2.2 -> take more than 10 minutes
      • with 50% fixed value (0) and 50% Math.random()
        • 2.0 -> take ~500 ms
        • 2.2 -> take ~250000 ms -> ~250 second
      • with 100% Math.random()
        • 2.0 -> take ~500 ms
        • 2.2 -> take ~70 ms
      1. percentile.png
        28 kB
        Paolo Repele

        Issue Links

          Activity

          Paolo Repele created issue -
          Mikkel Meyer Andersen made changes -
          Field Original Value New Value
          Assignee Mikkel Meyer Andersen [ mikl ]
          Paolo Repele made changes -
          Attachment percentile.png [ 12479338 ]
          Phil Steitz made changes -
          Fix Version/s 3.1 [ 12317576 ]
          Gilles made changes -
          Link This issue is related to MATH-805 [ MATH-805 ]
          Thomas Neidhart made changes -
          Link This issue is duplicated by MATH-805 [ MATH-805 ]
          Thomas Neidhart made changes -
          Link This issue is related to MATH-805 [ MATH-805 ]
          Thomas Neidhart made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Thomas Neidhart made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Mikkel Meyer Andersen
              Reporter:
              Paolo Repele
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development