QDeclarativeDebugTrace: Speed up appending elements to trace
authorKai Koehne <kai.koehne@nokia.com>
Tue, 11 Oct 2011 15:08:26 +0000 (17:08 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 12 Oct 2011 13:05:12 +0000 (15:05 +0200)
Using a QVector with a Q_MOVABLE_TYPE with QVector should speed up
appending stuff by a magnitude.

Change-Id: Icf5cee87a0f35d81bf85f833f5656a9b296c80fd
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>

src/declarative/debugger/qdeclarativedebugtrace_p.h

index 9480c0a..26535e1 100644 (file)
@@ -56,6 +56,7 @@
 #include <private/qdeclarativedebugservice_p.h>
 #include <QtCore/qelapsedtimer.h>
 #include <QtCore/qmutex.h>
+#include <QtCore/qvector.h>
 
 QT_BEGIN_HEADER
 
@@ -76,6 +77,8 @@ struct QDeclarativeDebugData
     QByteArray toByteArray() const;
 };
 
+Q_DECLARE_TYPEINFO(QDeclarativeDebugData, Q_MOVABLE_TYPE);
+
 class QUrl;
 class QDeclarativeEngine;
 
@@ -145,7 +148,7 @@ private:
     bool m_enabled;
     bool m_deferredSend;
     bool m_messageReceived;
-    QList<QDeclarativeDebugData> m_data;
+    QVector<QDeclarativeDebugData> m_data;
     QMutex m_mutex;
 };