Bug 39717
Summary: | very slow QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource) method. | ||
---|---|---|---|
Product: | WebKit | Reporter: | stawel |
Component: | WebKit Qt | Assignee: | 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
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Sriram
Seems to be a performance issue. Should be picked up.
vincent
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
=== 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.