summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-05-20 06:06:58 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-05-20 06:06:58 (GMT)
commit9852730f6a1fe66aab5a8e6a2b7c139bbd9fb011 (patch)
tree68fbc8f7a442e895a46bdaf5e6897d264737dbea /src/declarative
parentb5bada2b06d85ea74a851b98d3652aff8e64a723 (diff)
downloadQt-9852730f6a1fe66aab5a8e6a2b7c139bbd9fb011.zip
Qt-9852730f6a1fe66aab5a8e6a2b7c139bbd9fb011.tar.gz
Qt-9852730f6a1fe66aab5a8e6a2b7c139bbd9fb011.tar.bz2
Log performance of adding script to the engine.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/util/qfxperf.cpp1
-rw-r--r--src/declarative/util/qfxperf.h1
-rw-r--r--src/declarative/util/qmlscript.cpp6
3 files changed, 6 insertions, 2 deletions
diff --git a/src/declarative/util/qfxperf.cpp b/src/declarative/util/qfxperf.cpp
index ae51157..01ac878 100644
--- a/src/declarative/util/qfxperf.cpp
+++ b/src/declarative/util/qfxperf.cpp
@@ -70,5 +70,6 @@ Q_DEFINE_PERFORMANCE_LOG(QFxPerf, "QFx") {
Q_DEFINE_PERFORMANCE_METRIC(BaseLayoutComponentComplete, "QFxBaseLayout::componentComplete");
Q_DEFINE_PERFORMANCE_METRIC(TextComponentComplete, "QFxText::componentComplete");
Q_DEFINE_PERFORMANCE_METRIC(QFxText_setText, "QFxText::setText");
+ Q_DEFINE_PERFORMANCE_METRIC(AddScript, "QmlScript::addScriptToEngine");
}
QT_END_NAMESPACE
diff --git a/src/declarative/util/qfxperf.h b/src/declarative/util/qfxperf.h
index d1f3a5b..3430658 100644
--- a/src/declarative/util/qfxperf.h
+++ b/src/declarative/util/qfxperf.h
@@ -76,6 +76,7 @@ Q_DECLARE_PERFORMANCE_LOG(QFxPerf) {
Q_DECLARE_PERFORMANCE_METRIC(BaseLayoutComponentComplete);
Q_DECLARE_PERFORMANCE_METRIC(TextComponentComplete);
Q_DECLARE_PERFORMANCE_METRIC(QFxText_setText);
+ Q_DECLARE_PERFORMANCE_METRIC(AddScript);
}
#endif // _QFXPERF_H_
diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp
index d986b7a..d6d610a 100644
--- a/src/declarative/util/qmlscript.cpp
+++ b/src/declarative/util/qmlscript.cpp
@@ -55,11 +55,10 @@
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QtDeclarative/qmlinfo.h>
+#include <qfxperf.h>
QT_BEGIN_NAMESPACE
-
-
class QmlScriptPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QmlScript);
@@ -183,6 +182,9 @@ void QmlScript::replyFinished()
void QmlScriptPrivate::addScriptToEngine(const QString &script, const QString &fileName)
{
+#ifdef Q_ENABLE_PERFORMANCE_LOG
+ QFxPerfTimer<QFxPerf::AddScript> pt;
+#endif
Q_Q(QmlScript);
QmlEngine *engine = qmlEngine(q);
QmlContext *context = qmlContext(q);