aboutsummaryrefslogtreecommitdiffstats
path: root/tools/CMakeLists.txt
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2020-04-15 16:18:03 +0200
committerJan Arve Sæther <jan-arve.saether@qt.io>2020-05-04 15:11:12 +0200
commitcc77a0bc549ce8f0b218661e7ae0e82e5b89e0da (patch)
treed78d8902579be745ea823b10e56dcc2c4b06b89f /tools/CMakeLists.txt
parent788a3a183f8c49c1a88270c1456c3d47423df240 (diff)
Improve performance when dynamically adding items to a layout
This was especially noticeable when a Repeater was populating the children of a layout, and its model was dynamically changed: When the model was changed, the repeater removed one item at a time until all items were removed, then applied the new model and then added all the new items for the new model. The layout reacted to that by doing a full sync of the QML layout into the internal gridlayout engine each time an item got removed or added. For very large layouts (or layouts that have complex size hints to calculate), this caused a major slowdown. This patch fixes that by postponing the sync until we get a updatePolish(), basically replacing most calls to updateLayoutItems() (which does the sync) with a call to invalidate() (which schedules a polish). It will also get rid of some binding loop warnings due to this change. This means that there is a small change in behavior: impicitWidth, implicitHeight and Layout.{min,max}imum{Width,Height} might in some cases be incorrect until the updatePolish() have been done. (This is however consistent with how Row/Column/Grid behaves) The creation test in qmlbench was quite simple, so it did not suffer from the most severe performance issues, but we did not regress: > compareresults: auto/creation/layouts/delegates_rowlayout.qml: improvement by 3.91% auto/creation/layouts/delegates_columnlayout.qml: improvement by 6.59% auto/creation/layouts/delegates_gridlayout.qml: improvement by 1.83% Overall average of differences: 4.11% And for the gridlayout_large.qml (Repeater with 1000 dynamically changing items): > compareresults: auto/layouts/gridlayout_large.qml: improvement by 66477.78% Overall average of differences: 66477.78% [ChangeLog][Qt Quick Layouts] Performance improvements to Qt Quick Layouts. This has the small side-effect that size hints (implicitWidth/implicithHeight etc) changes are not immediately emitted after a layout has been modified (e.g item added) Pick-to: 5.15 Fixes: QTBUG-71839 Fixes: QTBUG-65121 Fixes: QTBUG-66017 Change-Id: I6922efe449134246df66b177992e4442747bc8fb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tools/CMakeLists.txt')
0 files changed, 0 insertions, 0 deletions