PDA

View Full Version : Profile Javascript



mlucool
29th August 2014, 18:42
Hi,

I have an application which uses a QWebView to render a QWebPage, but does not use QtQuick. This webpage is mostly javascript and I need to profile it. What are the recommended tools for doing this? I have tried to use the QML profiler (with Qt 5.3.1), but since there is no QML, it does not comes up with no stats. To get this to work, I had to add some QML code just to have it open: "QQuickView *qmlView = new QQuickView" but that code is otherwise unused.

In my javascript file I have added console.profile/profileEnd to the required function. Is there a way to redirect this console or connect it to some profiler? The application uses Qt 5.2 but can be upgraded if needed.

Thanks,
Marc

wysota
29th August 2014, 18:45
You should be able to use any Javascript profiler available. Qt does not have any support for profiling Javascript code. It only has a regular WebKit's Web inspector.