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

QPainter.drawPolyline performance issue

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 5.15.3
    • PySide
    • None
    • Windows 10
    • Windows
    • 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. qtnumpy.py
          3 kB
        2. pyside1366.py
          3 kB
        3. pyside1366_pyqt.py
          3 kB
        4. pyside1366_log.txt
          61 kB
        5. pyside1366_diag.diff
          3 kB

        Issue Links

          For Gerrit Dashboard: PYSIDE-1366
          # Subject Branch Project Status CR V

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              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