diff options
author | Robin Burchell <robin+qt@viroteck.net> | 2012-09-02 12:18:14 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-04 02:03:23 +0200 |
commit | 8486a510d5fb6c9ecd03dba0a49fd4f6d55c3bca (patch) | |
tree | 0ed79a01e9fd1f1af1a7d7a11758e1ee98f208d4 /src/widgets/graphicsview/qgraphicsitem_p.h | |
parent | ce2a8bdc13891cf1f53863bd5cd22d1a8fd6aae1 (diff) |
graphicsview: use std::sort instead of qSort
In almost all cases, std::sort is wildly faster than qSort - but especially in
the case where the input data is already sorted. in some stress tests which ran
through the index with a lot of items, this commit provides huge speedup (684ms
down to 10ms for painting 15001 empty items on the provided benchmark), for me.
Task-number: QTBUG-11022
Change-Id: I5551f8e320c33ba13d464bf22047a665c81f3b74
Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsitem_p.h')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem_p.h b/src/widgets/graphicsview/qgraphicsitem_p.h index 77b54c1325..4344fa8097 100644 --- a/src/widgets/graphicsview/qgraphicsitem_p.h +++ b/src/widgets/graphicsview/qgraphicsitem_p.h @@ -826,7 +826,7 @@ inline void QGraphicsItemPrivate::ensureSortedChildren() sequentialOrdering = 1; if (children.isEmpty()) return; - qSort(children.begin(), children.end(), qt_notclosestLeaf); + std::sort(children.begin(), children.end(), qt_notclosestLeaf); for (int i = 0; i < children.size(); ++i) { if (children.at(i)->d_ptr->siblingIndex != i) { sequentialOrdering = 0; |