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

Particles needsReset performance issue

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P2: Important
    • 6.1, 6.2
    • 6.1
    • Quick: Particles
    • None
    • 1
    • 6f1ed8b46abed1a2190c12f8d7b272b075efa0e8, f542e2bd35767e97ce6b328a23e21791a4ccbed9
    • Qt Quick 3D - 2021 Week 21/22

    Description

      I was doing Qt6 dev profiling yesterday and bumped into https://codereview.qt-project.org/c/qt/qtdeclarative/+/301377

      Noticed that QQuickParticleAffector::postAffect inserting data into needsReset is slow. And the reason is that QFlatSet insert uses std::find to prevent duplicates, which drags the perf down when the amount of particles increases.

      Attached a simple example application which allows increasing the particles amount and seeing a simple fps counter, use better profiling if needed. Same can be seen with other particles examples as long as they have more particles and at least one affector.

      The results I get on Galaxy Tab A7:

       

      particles | QFlatSet | QSet
      5000        34 fps     60 fps
      10000       9 fps      38 fps
      15000       4 fps      28 fps 
      

      So when the amount of particles grows, QSet performs up to ~7 x better.

      Are there examples & hardware where QFlatSet in this place performs notably better? If not, should we switch back to QSet at least on Qt 6 dev? Or do some better optimization here?

      Attachments

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

        Activity

          People

            kagro Kaj Grönholm
            kagro Kaj Grönholm
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes