diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-10 12:34:36 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-16 10:56:03 +0000 |
commit | 497ccdc843975bfe20f5b24e083d17f01012efb9 (patch) | |
tree | ceba5b1b4e2716fe3d1ca005ac5d733fd36097c7 /src/qml/debugger/qqmlprofiler_p.h | |
parent | 5870667929ac5f45805b1e1e656fec81b9b22337 (diff) |
Speed up binding evaluation
Don't spend any cycles of determining the location of the binding (file, line,
column) unless we really need that information. That's the case when the profiler
is active or an error happens.
Change-Id: Iae97808d500b88fed6a813e8b224aa6ebe04d3b6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/debugger/qqmlprofiler_p.h')
-rw-r--r-- | src/qml/debugger/qqmlprofiler_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h index ba85a76277..5c994b112f 100644 --- a/src/qml/debugger/qqmlprofiler_p.h +++ b/src/qml/debugger/qqmlprofiler_p.h @@ -112,11 +112,11 @@ Q_DECLARE_TYPEINFO(QQmlProfilerData, Q_MOVABLE_TYPE); class QQmlProfiler : public QObject, public QQmlProfilerDefinitions { Q_OBJECT public: - void startBinding(const QString &fileName, int line, int column) + void startBinding(const QQmlSourceLocation &location) { m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), (1 << RangeStart | 1 << RangeLocation), 1 << Binding, - fileName, line, column)); + location.sourceFile, qmlSourceCoordinate(location.line), qmlSourceCoordinate(location.column))); } // Have toByteArrays() construct another RangeData event from the same QString later. @@ -201,11 +201,11 @@ struct QQmlProfilerHelper : public QQmlProfilerDefinitions { }; struct QQmlBindingProfiler : public QQmlProfilerHelper { - QQmlBindingProfiler(QQmlProfiler *profiler, const QString &url, int line, int column) : + QQmlBindingProfiler(QQmlProfiler *profiler, const QV4::FunctionObject *function) : QQmlProfilerHelper(profiler) { Q_QML_PROFILE(QQmlProfilerDefinitions::ProfileBinding, profiler, - startBinding(url, line, column)); + startBinding(function->sourceLocation())); } ~QQmlBindingProfiler() |