Qt Quick 3D - 2021 Week 21/22
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?
|For Gerrit Dashboard: QTBUG-92977|
|349467,2||Switch from QFlatSet to QSet in particles||dev||qt/qtdeclarative||Status: MERGED||+2||0|
|349573,2||Switch from QFlatSet to QSet in particles||6.1||qt/qtdeclarative||Status: MERGED||+2||0|