Fix performance bottleneck in QQuickWindow::mouseMoveEvent().
authorSérgio Martins <sergio.martins.qnx@kdab.com>
Fri, 7 Sep 2012 11:00:30 +0000 (12:00 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 11 Oct 2012 14:07:33 +0000 (16:07 +0200)
commit2c9886dfb9d448b08794d88ea112076c2744f194
treeb569067de827a34cc24c37014d77bf4de30afea7
parentcad818ae17c5537a2bbf733806719eafa8227032
Fix performance bottleneck in QQuickWindow::mouseMoveEvent().

When a mouse move event is received, a lot of time is spent looking
for items with cursors, recursively.

With this patch, it will only recur into item hierarchies that
contain cursors.

Not having cursors is much more common than having them.

Benchmark included:
Before: 15 msecs per iteration (total: 62, iterations: 4)
After: 0.000064 msecs per iteration (total: 68, iterations: 1048576)

Task-number: QTBUG-27054
Change-Id: I3a5441652ca1c0b8d2cbc5683013562174f5af4a
Reviewed-by: Alan Alpert <416365416c@gmail.com>
src/quick/items/qquickitem.cpp
src/quick/items/qquickitem_p.h
src/quick/items/qquickwindow.cpp
tests/benchmarks/qml/qml.pro
tests/benchmarks/qml/qquickwindow/qquickwindow.pro [new file with mode: 0644]
tests/benchmarks/qml/qquickwindow/tst_qquickwindow.cpp [new file with mode: 0644]