summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-11-03 00:24:29 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-11-19 00:51:02 (GMT)
commit458c237ea807330de8b15cb2b6e99f564bb7fd66 (patch)
treebc96856677be08f3d8e59312738ea22232c03dfb /src/declarative
parent3d100ab29820b4dcf14afbcadb05d0bf40fdacbc (diff)
downloadQt-458c237ea807330de8b15cb2b6e99f564bb7fd66.zip
Qt-458c237ea807330de8b15cb2b6e99f564bb7fd66.tar.gz
Qt-458c237ea807330de8b15cb2b6e99f564bb7fd66.tar.bz2
Use high performance timer for profiling. Add binding profile info.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/debugger/qdeclarativedebugtrace_p.h5
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp15
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings.cpp3
3 files changed, 21 insertions, 2 deletions
diff --git a/src/declarative/debugger/qdeclarativedebugtrace_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h
index 704c49a..d6fe0b0 100644
--- a/src/declarative/debugger/qdeclarativedebugtrace_p.h
+++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h
@@ -43,7 +43,7 @@
#define QDECLARATIVEDEBUGTRACE_P_H
#include <private/qdeclarativedebugservice_p.h>
-#include <QtCore/qelapsedtimer.h>
+#include <private/qperformancetimer_p.h>
QT_BEGIN_HEADER
@@ -74,6 +74,7 @@ public:
Painting,
Compiling,
Creating,
+ Binding,
MaximumRangeType
};
@@ -90,7 +91,7 @@ private:
void startRangeImpl(RangeType);
void rangeDataImpl(RangeType, const QUrl &);
void endRangeImpl(RangeType);
- QElapsedTimer m_timer;
+ QPerformanceTimer m_timer;
};
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp
index cb6ad8c..2a1abd0 100644
--- a/src/declarative/qml/qdeclarativebinding.cpp
+++ b/src/declarative/qml/qdeclarativebinding.cpp
@@ -49,6 +49,7 @@
#include "private/qdeclarativedata_p.h"
#include "private/qdeclarativestringconverters_p.h"
#include "private/qdeclarativestate_p_p.h"
+#include "private/qdeclarativedebugtrace_p.h"
#include <QVariant>
#include <QtCore/qdebug.h>
@@ -114,6 +115,19 @@ QDeclarativeProperty QDeclarativeBinding::property() const
return d->property;
}
+class QDeclarativeBindingProfiler {
+public:
+ QDeclarativeBindingProfiler()
+ {
+ QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Binding);
+ }
+
+ ~QDeclarativeBindingProfiler()
+ {
+ QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Binding);
+ }
+};
+
void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags)
{
Q_D(QDeclarativeBinding);
@@ -122,6 +136,7 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags)
return;
if (!d->updating) {
+ QDeclarativeBindingProfiler prof;
d->updating = true;
bool wasDeleted = false;
d->deleted = &wasDeleted;
diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp
index 5f0fd56..77fb48e 100644
--- a/src/declarative/qml/qdeclarativecompiledbindings.cpp
+++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp
@@ -54,6 +54,7 @@
#include <private/qdeclarativeanchors_p_p.h>
#include <private/qdeclarativeglobal_p.h>
#include <private/qdeclarativefastproperties_p.h>
+#include <private/qdeclarativedebugtrace_p.h>
QT_BEGIN_NAMESPACE
@@ -316,7 +317,9 @@ int QDeclarativeCompiledBindingsPrivate::Binding::propertyIndex()
void QDeclarativeCompiledBindingsPrivate::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags)
{
+ QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Binding);
parent->run(this, flags);
+ QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Binding);
}
void QDeclarativeCompiledBindingsPrivate::Binding::destroy()