Web Inspector: Detailed heap snapshot. _calculateFlags is too slow on a large heap...
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jan 2012 11:36:38 +0000 (11:36 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jan 2012 11:36:38 +0000 (11:36 +0000)
commit7566878d6d79dd44bc851ee4adb9679a3efc943e
treeeda1e0cccf2a80d241c96ace24e0a8302e8c9c06
parent1bab84aaa9047b446c2dccf48c254a575faeb04f
Web Inspector: Detailed heap snapshot. _calculateFlags is too slow on a large heap snapshot.
https://bugs.webkit.org/show_bug.cgi?id=76252

_calculateFlags speed is about 10k edges per second.
It requires 150sec for the snapshot with 1.5m edges.
The root of problem is var node = list.shift();
shift() is not effective in term of memory and cpu.
In our case it can be replaced with pop().
Now the function works 40 times faster.

Drive by change: if statement was reformatted a bit for better readability.

Reviewed by Yury Semikhatsky.

* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshot.prototype._calculateFlags):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/HeapSnapshot.js