From 39496a40748be1d60c909ba679c45c788ec6412f Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Wed, 23 Nov 2016 14:31:11 +0100 Subject: QQmlDelegateModel: Avoid allocating unnecessarily Wait for the update request to be posted and take effect before piling another one up. This speeds up qmlbench creation benchmarks a bit (as they make use of Repeater). Results for benchmark/creation/delegates_item on a 5.6 base on a 2011 mbp: Before: Average: 670.4 ops/frame; using 5/5 samples; MedianAll=674; StdDev=6.34, CoV=0.00946 - StdDev (all samples included)=6.34 After: Average: 702 ops/frame; using 5/5 samples; MedianAll=700; StdDev=8.97, CoV=0.0128 - StdDev (all samples included)=8.97 Change-Id: Ic0ef4c1e2d6cb309edeb512cad4280a15abc7a06 Reviewed-by: Gunnar Sletta Reviewed-by: Shawn Rutledge --- src/qml/types/qqmldelegatemodel_p_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qml/types/qqmldelegatemodel_p_p.h') diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h index 6cb82fddfc..7d97358b3d 100644 --- a/src/qml/types/qqmldelegatemodel_p_p.h +++ b/src/qml/types/qqmldelegatemodel_p_p.h @@ -149,7 +149,6 @@ public: int groups; int index; - Q_SIGNALS: void modelIndexChanged(); @@ -261,6 +260,7 @@ public: void init(); void connectModel(QQmlAdaptorModel *model); + void requestMoreIfNecessary(); QObject *object(Compositor::Group group, int index, bool asynchronous); QQmlDelegateModel::ReleaseFlags release(QObject *object); QString stringValue(Compositor::Group group, int index, const QString &name); @@ -329,6 +329,7 @@ public: bool m_reset : 1; bool m_transaction : 1; bool m_incubatorCleanupScheduled : 1; + bool m_waitingToFetchMore : 1; union { struct { -- cgit v1.2.3