Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1366

QPainter.drawPolyline performance issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 5.15
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      Windows 10
    • Platform/s:
      Windows
    • Commits:
      b016f35f94e061ee296d65dbbcb2c7c9e4a988d0 (pyside/pyside-setup/5.15)

      Description

      In the context of the PythonQwt project, I'm implementing widgets for drawing curves efficiently in pure Python (+ NumPy +Qt). This is working quite well with PyQt4 and PyQt5. Lately, I've been trying to add support for PySide2.

      While optimizing a function for creating efficiently a QPolygonF object from a NumPy array, I came accross a performance issue with the QPainter.drawPolyline drawing primitive (for 1e6 points).

      You will find attached a test script showing those results on my machine:

      • dt[PyQt5 v5.15.0] = 19 ms
      • dt[PySide2 v5.15.0] = 1115 ms (i.e. approx. 60 times slower than PyQt5)

      Test script requirements : QtPy, PyQt5 or PySide2, NumPy (the latter is only used for generating the huge amount of data which is injected into the QPolygonF object).

        Attachments

        1. pyside1366_diag.diff
          3 kB
        2. pyside1366_log.txt
          61 kB
        3. pyside1366_pyqt.py
          3 kB
        4. pyside1366.py
          3 kB
        5. qtnumpy.py
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            crmaurei Cristian Maureira-Fredes
            Reporter:
            pierre_raybaut Pierre Raybaut
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes