Bug 39717

Summary: very slow QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource) method.
Product: WebKit Reporter: stawel
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: cmarcelo, laszlo.gombos, lypkiller, sriram.yadavalli
Priority: P2 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   

stawel
Reported 2010-05-26 03:06:20 PDT
Hi all, I noticed that the QWebFrame method evaluateJavaScript(const QString& scriptSource) is very slow. consider this code: class MyClass : public QWebFrame { void do() { QString script = QString(" \ var main = document.getElementById('main'); \ var newDivElement = document.createElement('div'); \ main.appendChild(newDivElement); "); //first loop execution time > 5 minutes !!!!! for(int i=0;i<500;i++) evaluateJavaScript(script); //second loop execution time < 0.1 sec for(int i=0;i<500;i++) evaluateJavaScript(script + "false;"); } } it looks like that the calculation of the result (JSC::Bindings::convertValueToQVariant) is very slow. maybe a lazy calculation would be better. Best Regards
Attachments
Sriram
Comment 1 2010-06-08 11:16:57 PDT
Seems to be a performance issue. Should be picked up.
vincent
Comment 2 2013-07-28 19:17:02 PDT
as I see, the worst place of performance is tampering the html. eg.(JQUERY) $("<a class='savetolocal'>SAVE</a>").insertAfter(current); i hope the qwebkit can offer some interface to extend the brower. like firefox's extension. user can excute extra script after loading page.
Jocelyn Turcotte
Comment 3 2014-02-03 03:50:45 PST
=== Bulk closing of Qt bugs === If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it. If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.
Note You need to log in before you can comment on or make changes to this bug.