graphicsview: use std::sort instead of qSort
authorRobin Burchell <robin+qt@viroteck.net>
Sun, 2 Sep 2012 10:18:14 +0000 (12:18 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 4 Sep 2012 00:03:23 +0000 (02:03 +0200)
commit8486a510d5fb6c9ecd03dba0a49fd4f6d55c3bca
tree0ed79a01e9fd1f1af1a7d7a11758e1ee98f208d4
parentce2a8bdc13891cf1f53863bd5cd22d1a8fd6aae1
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>
src/widgets/graphicsview/qgraphicsitem.cpp
src/widgets/graphicsview/qgraphicsitem_p.h
src/widgets/graphicsview/qgraphicsscene.cpp
src/widgets/graphicsview/qgraphicsscene_p.h
src/widgets/graphicsview/qgraphicsscenebsptreeindex.cpp