aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2013-11-26 15:54:43 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-29 11:35:09 +0100
commite0a0b81427f311464a9dbfcd7bf297229a6100e1 (patch)
treecf697c801d40840424d8a39a222edb7a03373265 /src
parent4c76d3083ac8a3a702559473e669e2cadb35c642 (diff)
Remove old qml object creation profiling
The old way the object creation profiler works is unsuitable for detailed profiling as it only tracks top level components. Task-number: QTCREATORBUG-10631 Change-Id: I502d0e144f2965f5e09af8461b50b56c61de5b4b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/debugger/qqmlprofilerservice_p.h35
-rw-r--r--src/qml/qml/qqmlcomponent.cpp16
-rw-r--r--src/qml/qml/qqmlcomponent_p.h4
-rw-r--r--src/qml/qml/qqmlengine.cpp8
4 files changed, 1 insertions, 62 deletions
diff --git a/src/qml/debugger/qqmlprofilerservice_p.h b/src/qml/debugger/qqmlprofilerservice_p.h
index fb08a30c6a..52a1dead09 100644
--- a/src/qml/debugger/qqmlprofilerservice_p.h
+++ b/src/qml/debugger/qqmlprofilerservice_p.h
@@ -225,7 +225,6 @@ private:
friend struct QQmlBindingProfiler;
friend struct QQmlHandlingSignalProfiler;
- friend struct QQmlObjectCreatingProfiler;
friend struct QQmlCompilingProfiler;
friend struct QQmlPixmapProfiler;
};
@@ -277,40 +276,6 @@ struct QQmlHandlingSignalProfiler {
bool enabled;
};
-struct QQmlObjectCreatingProfiler {
- QQmlObjectCreatingProfiler()
- {
- enabled = QQmlProfilerService::instance
- ? QQmlProfilerService::instance->profilingEnabled() : false;
- if (enabled) {
- QQmlProfilerService *service = QQmlProfilerService::instance;
- service->startRange(QQmlProfilerService::Creating);
- }
- }
-
- void setTypeName(const QString &typeName)
- {
- Q_ASSERT_X(enabled, Q_FUNC_INFO, "method called although profiler is not enabled.");
- QQmlProfilerService::instance->rangeData(QQmlProfilerService::Creating, typeName);
- }
-
- void setLocation(const QUrl &url, int line, int column)
- {
- Q_ASSERT_X(enabled, Q_FUNC_INFO, "method called although profiler is not enabled.");
- if (enabled)
- QQmlProfilerService::instance->rangeLocation(
- QQmlProfilerService::Creating, url, line, column);
- }
-
- ~QQmlObjectCreatingProfiler()
- {
- if (enabled)
- QQmlProfilerService::instance->endRange(QQmlProfilerService::Creating);
- }
-
- bool enabled;
-};
-
struct QQmlCompilingProfiler {
QQmlCompilingProfiler(const QString &name)
{
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 2973944215..ae246f5cd4 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -52,7 +52,6 @@
#include "qqmlbinding_p.h"
#include "qqmlglobal_p.h"
#include "qqmlscript_p.h"
-#include <private/qqmlprofilerservice_p.h>
#include <private/qqmlenginedebugservice_p.h>
#include "qqmlincubator.h"
#include "qqmlincubator_p.h"
@@ -884,11 +883,6 @@ QQmlComponentPrivate::beginCreate(QQmlContextData *context)
QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(engine);
- if (enginePriv->inProgressCreations == 0) {
- // only track root, since further ones might not be properly nested
- profiler = new QQmlObjectCreatingProfiler();
- }
-
enginePriv->inProgressCreations++;
state.errors.clear();
state.completePending = true;
@@ -924,13 +918,6 @@ QQmlComponentPrivate::beginCreate(QQmlContextData *context)
if (!context->isInternal)
context->asQQmlContextPrivate()->instances.append(rv);
QQmlEngineDebugService::instance()->objectCreated(engine, rv);
-
- if (profiler && profiler->enabled) {
- profiler->setTypeName(buildTypeNameForDebug(rv->metaObject()));
- QQmlData *data = QQmlData::get(rv);
- Q_ASSERT(data);
- profiler->setLocation(cc->url, data->lineNumber, data->columnNumber);
- }
}
return rv;
@@ -995,9 +982,6 @@ void QQmlComponentPrivate::completeCreate()
if (state.completePending) {
QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine);
complete(ep, &state);
-
- delete profiler;
- profiler = 0;
}
if (depthIncreased) {
diff --git a/src/qml/qml/qqmlcomponent_p.h b/src/qml/qml/qqmlcomponent_p.h
index d9a2427cd5..8bf4005dd6 100644
--- a/src/qml/qml/qqmlcomponent_p.h
+++ b/src/qml/qml/qqmlcomponent_p.h
@@ -61,7 +61,6 @@
#include "qqmlvme_p.h"
#include "qqmlerror.h"
#include "qqml.h"
-#include <private/qqmlprofilerservice_p.h>
#include <private/qqmlobjectcreator_p.h>
#include <QtCore/QString>
@@ -85,7 +84,7 @@ class Q_QML_PRIVATE_EXPORT QQmlComponentPrivate : public QObjectPrivate, public
public:
QQmlComponentPrivate()
- : typeData(0), progress(0.), start(-1), cc(0), engine(0), creationContext(0), profiler(0), depthIncreased(false) {}
+ : typeData(0), progress(0.), start(-1), cc(0), engine(0), creationContext(0), depthIncreased(false) {}
void loadUrl(const QUrl &newUrl, QQmlComponent::CompilationMode mode = QQmlComponent::PreferSynchronous);
@@ -131,7 +130,6 @@ public:
QQmlEngine *engine;
QQmlGuardedContextData creationContext;
- QQmlObjectCreatingProfiler *profiler;
bool depthIncreased;
void clear();
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 5b05576129..1f45cba732 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -1339,14 +1339,6 @@ void qmlExecuteDeferred(QObject *object)
QQmlData *data = QQmlData::get(object);
if (data && data->deferredData && !data->wasDeleted(object)) {
- QQmlObjectCreatingProfiler prof;
- if (prof.enabled) {
- QQmlType *type = QQmlMetaType::qmlType(object->metaObject());
- prof.setTypeName(type ? type->qmlTypeName()
- : QString::fromUtf8(object->metaObject()->className()));
- if (data->outerContext)
- prof.setLocation(data->outerContext->url, data->lineNumber, data->columnNumber);
- }
QQmlEnginePrivate *ep = QQmlEnginePrivate::get(data->context->engine);
QQmlComponentPrivate::ConstructionState state;