From: Glenn Watson Date: Thu, 27 Oct 2011 03:13:23 +0000 (+1000) Subject: Force V8 debugger load on startup instead of on demand. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=64b8ce5f60d0595fcc511ca860066f2d946db8f3;p=konrad%2Fqtdeclarative.git Force V8 debugger load on startup instead of on demand. The V8 debugger code can take several hundred milliseconds to start. This is by default loaded and unloaded on demand, for example whenever a script is compiled. This has a significant effect on the timing reported by the QML profiler in Qt Creator. This change forces the debugger context to be loaded when the v8 context is created, so that this cost is paid once on startup and no longer affects the QML profiling times. Task-number: QTBUG-22170 Change-Id: I5533b53908b3c53e18b0eb870ed6166d109429df Reviewed-by: Aaron Kennedy --- diff --git a/src/declarative/debugger/qv8debugservice.cpp b/src/declarative/debugger/qv8debugservice.cpp index 4909152..e36c4bd 100644 --- a/src/declarative/debugger/qv8debugservice.cpp +++ b/src/declarative/debugger/qv8debugservice.cpp @@ -124,6 +124,13 @@ QV8DebugService::QV8DebugService(QObject *parent) { Q_D(QV8DebugService); v8::Debug::SetMessageHandler2(DebugMessageHandler); + + // This call forces the debugger context to be loaded and made resident. + // Without this the debugger is loaded/unloaded whenever required, which + // has a very significant effect on the timing reported in the QML + // profiler in Qt Creator. + v8::Debug::GetDebugContext(); + if (status() == Enabled) { // ,block mode, client attached while (!d->initialized) {