aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qqmllistmodel_p_p.h
diff options
context:
space:
mode:
authorArnaud Vrac <avrac@freebox.fr>2015-07-24 15:59:33 +0200
committerArnaud Vrac <avrac@freebox.fr>2017-05-05 11:16:45 +0000
commitcef5e9d385d0cf78e43e8ea41edf253b78f0ca13 (patch)
treeff17e42290644e66fa16f51179b2bffa43c112aa /src/qml/types/qqmllistmodel_p_p.h
parent4be38abab97f07b999ca3b2da3c45c5423d83dc0 (diff)
QQmlListModel: Optimize model updates
Only update changed indices in the list model on insertion, deletion or move. This can greatly improves performance when inserting or removing near the end of the list, or when moving elements in a large model. On a work in progress version of qmlbench's modelperf_listmodel_addremove.qml, this appears to improve performance quite a bit (~40%): Before: Average: 363.4 frames; using samples; MedianAll=363; StdDev=5.31977, CoV=0.0146389 After: Average: 518.2 frames; using samples; MedianAll=518; StdDev=20.5475, CoV=0.0396517 Change-Id: I8ce7bea4ab8b1c7c3d0fbccc40b9a12ca3eadf59 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/qml/types/qqmllistmodel_p_p.h')
-rw-r--r--src/qml/types/qqmllistmodel_p_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h
index 44583df2a6..e2653c220d 100644
--- a/src/qml/types/qqmllistmodel_p_p.h
+++ b/src/qml/types/qqmllistmodel_p_p.h
@@ -397,7 +397,7 @@ private:
void newElement(int index);
- void updateCacheIndices();
+ void updateCacheIndices(int start = 0, int end = -1);
friend class ListElement;
friend class QQmlListModelWorkerAgent;