Title: [140805] trunk/Source/WebCore
Revision
140805
Author
pfeld...@chromium.org
Date
2013-01-25 02:24:16 -0800 (Fri, 25 Jan 2013)

Log 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 n^2 complexity for unique URI calculation.

* inspector/front-end/SimpleWorkspaceProvider.js:
(WebInspector.SimpleWorkspaceProvider):
(WebInspector.SimpleWorkspaceProvider.prototype.uniqueURI):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (140804 => 140805)


--- trunk/Source/WebCore/ChangeLog	2013-01-25 10:18:08 UTC (rev 140804)
+++ trunk/Source/WebCore/ChangeLog	2013-01-25 10:24:16 UTC (rev 140805)
@@ -1,3 +1,16 @@
+2013-01-25  Pavel Feldman  <pfeld...@chromium.org>
+
+        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 n^2 complexity for unique URI calculation.
+
+        * inspector/front-end/SimpleWorkspaceProvider.js:
+        (WebInspector.SimpleWorkspaceProvider):
+        (WebInspector.SimpleWorkspaceProvider.prototype.uniqueURI):
+
 2013-01-25  Jussi Kukkonen  <jussi.kukko...@intel.com>
 
         [CMake][EFL] Build ThirdParty/leveldb when IndexedDB is enabled

Modified: trunk/Source/WebCore/inspector/front-end/SimpleWorkspaceProvider.js (140804 => 140805)


--- trunk/Source/WebCore/inspector/front-end/SimpleWorkspaceProvider.js	2013-01-25 10:18:08 UTC (rev 140804)
+++ trunk/Source/WebCore/inspector/front-end/SimpleWorkspaceProvider.js	2013-01-25 10:24:16 UTC (rev 140805)
@@ -38,6 +38,7 @@
     this._workspace = workspace;
     /** @type {Object.<string, WebInspector.ContentProvider>} */
     this._contentProviders = {};
+    this._lastUniqueSuffix = 0;
 }
 
 /**
@@ -129,8 +130,8 @@
     uniqueURI: function(uri)
     {
         var uniqueURI = uri;
-        for (var i = 1; this._contentProviders[uniqueURI]; ++i)
-            uniqueURI = uri + " (" + i + ")";
+        while (this._contentProviders[uniqueURI])
+            uniqueURI = uri + " (" + (++this._lastUniqueSuffix) + ")";
         return uniqueURI;
     },
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to