Changeset 140805 in webkit


Ignore:
Timestamp:
Jan 25, 2013 2:24:16 AM (11 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: inspector slows down pages with many anonymous scripts.
https://bugs.webkit.org/show_bug.cgi?id=107928

Reviewed by Alexander Pavlov.

The problem was that workspace code introduced n2 complexity for unique URI calculation.

  • inspector/front-end/SimpleWorkspaceProvider.js:

(WebInspector.SimpleWorkspaceProvider):
(WebInspector.SimpleWorkspaceProvider.prototype.uniqueURI):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140804 r140805  
     12013-01-25  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: inspector slows down pages with many anonymous scripts.
     4        https://bugs.webkit.org/show_bug.cgi?id=107928
     5
     6        Reviewed by Alexander Pavlov.
     7
     8        The problem was that workspace code introduced n^2 complexity for unique URI calculation.
     9
     10        * inspector/front-end/SimpleWorkspaceProvider.js:
     11        (WebInspector.SimpleWorkspaceProvider):
     12        (WebInspector.SimpleWorkspaceProvider.prototype.uniqueURI):
     13
    1142013-01-25  Jussi Kukkonen  <jussi.kukkonen@intel.com>
    215
  • trunk/Source/WebCore/inspector/front-end/SimpleWorkspaceProvider.js

    r139859 r140805  
    3939    /** @type {Object.<string, WebInspector.ContentProvider>} */
    4040    this._contentProviders = {};
     41    this._lastUniqueSuffix = 0;
    4142}
    4243
     
    130131    {
    131132        var uniqueURI = uri;
    132         for (var i = 1; this._contentProviders[uniqueURI]; ++i)
    133             uniqueURI = uri + " (" + i + ")";
     133        while (this._contentProviders[uniqueURI])
     134            uniqueURI = uri + " (" + (++this._lastUniqueSuffix) + ")";
    134135        return uniqueURI;
    135136    },
Note: See TracChangeset for help on using the changeset viewer.