Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-136788

Unefficient spline interpolation

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • 6.11
    • 6.9.0
    • Graphs: 2D
    • None
    • All

      The implementation of QSplineSeries could be done in a more efficient way:

      a) performance

      QSplineSeriesPrivate::calculateSplinePoints iterates too often ( IIRC 7 times ) what could be done in one loop.

      b) memory ( temporary )

      the loops ( above ) create temporary buffers that multiplies the memory usage during the calculation

      c) memory ( permanent )

      the result of the calculation are the 2 control points for each line describing the interpolating bezier curve.

      However for an interpolation of C1 continuity you only need to store the slope(s) ( 2 for parametric splines ). The corresponding Bezier curve can be found from the points/slopes when painting on the fly.

      IIRC correctly the Bezier curves ( = polynomials ) will be translated into a QPainterPath later, what doubles the temporary memory requirements. My guess is that this is done to process the lines in some sort of "doing it all" path.

        For Gerrit Dashboard: QTBUG-136788
        # Subject Branch Project Status CR V

            owaisakhtar Owais Akhtar
            uwe Uwe Rathmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change