Changeset 112066 in webkit


Ignore:
Timestamp:
Mar 26, 2012 2:07:43 AM (12 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: replace indexOf('a text') === 0 with RegExp because it is much faster.
https://bugs.webkit.org/show_bug.cgi?id=82175

We were using aString.indexOf("Window") but it is not effective from performance point of view.
I'm replaced it with RegExp.

Reviewed by Yury Semikhatsky.

  • inspector/front-end/HeapSnapshot.js:

(WebInspector.HeapSnapshotNode.prototype.get isWindow):
(WebInspector.HeapSnapshotNode.prototype.get isDetachedDOMTree):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112064 r112066  
     12012-03-26  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: replace indexOf('a text') === 0 with RegExp because it is much faster.
     4        https://bugs.webkit.org/show_bug.cgi?id=82175
     5
     6        We were using aString.indexOf("Window") but it is not effective from performance point of view.
     7        I'm replaced it with RegExp.
     8
     9        Reviewed by Yury Semikhatsky.
     10
     11        * inspector/front-end/HeapSnapshot.js:
     12        (WebInspector.HeapSnapshotNode.prototype.get isWindow):
     13        (WebInspector.HeapSnapshotNode.prototype.get isDetachedDOMTree):
     14
    1152012-03-26  Pavel Feldman  <pfeldman@chromium.org>
    216
  • trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js

    r111702 r112066  
    635635    get isWindow()
    636636    {
    637         return this.name.indexOf("Window") === 0;
     637        const windowRE = /^Window/;
     638        return windowRE.test(this.name);
    638639    },
    639640
     
    645646    get isDetachedDOMTree()
    646647    {
    647         return this.className.indexOf("Detached DOM tree") === 0;
     648        const detachedDOMTreeRE = /^Detached DOM tree/;
     649        return detachedDOMTreeRE.test(this.className);
    648650    },
    649651
Note: See TracChangeset for help on using the changeset viewer.