Bug 107608
Summary: | Web Inspector: Opening script panel and opening the CMD+O script open panel is slow for large numbers of files | ||
---|---|---|---|
Product: | WebKit | Reporter: | Malte Ubl <malte> |
Component: | Web Inspector (Deprecated) | Assignee: | Mike West <mkwst> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | apavlov, keishi, loislo, mkwst, paulirish, pfeldman, pmuellr, vsevik, web-inspector-bugs, yurys |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://jsbin.com/eluqam/1 |
Malte Ubl
We use //@ sourceURL annotations to load large numbers of JS files via a single HTTP requests during development. If the number of files gets large, opening the script panel and opening files using the file picker dialog becomes relatively slow (3 seconds on my machine).
Example
for (var i = 0; i < 2000; i++) {
eval('function i' + i +
'() { console.log(' + i + ') }\n//@ sourceURL=jsfile://foo.com/' +
i + '.js')
}
http://jsbin.com/eluqam/1
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Mike West
Profiling this shows that a huge chunk of time is taken up repeatedly doing a binary search over the tree (in TreeOutline.prototype.appendChild) to determine where to insert new children. Dropping sorting entirely speeds things up quite a bit. Not perfect, but significantly better.
I'll fiddle with sorting outside the tree view to see what impact that has.
Vsevolod Vlasov
We have fixed this recently in https://bugs.webkit.org/show_bug.cgi?id=107122.
This was happening because we were using localeCompare which is apparently much more (Naive performance measuring showed 2000x difference) slower than string comparison.
You can try using latest builds, e.g. Chrome Canary to check if this works for you now.
*** This bug has been marked as a duplicate of bug 107122 ***
Malte Ubl
Nice, with our work load it still isn't speedy but much better!
Thank You!
Pavel Feldman
@malte: it uses viewport now, should be really fast.