Linkifier.reset has complexity O(N^2) where N is the number of LiveLocation objects. It indirectly calls Array.remove operation which scan entire array and does shift operation.
Created attachment 189935 [details] Patch
You should use new Map() instead - it generates ids automatically.
(In reply to comment #2) > You should use new Map() instead - it generates ids automatically. We have two different maps. One in Script.js the other in UISourceCode.js So we need to have a guarantee that the identifiers are unique. Also Map uses at least 50% more memory because actually it maps number to the array of two elements, Key and Value. Probably we need to introduce Set.
Comment on attachment 189935 [details] Patch Attachment 189935 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://queues.webkit.org/results/16723855 New failing tests: inspector/debugger/script-formatter-console.html
Comment on attachment 189935 [details] Patch Attachment 189935 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/16729030 New failing tests: inspector/debugger/callstack-placards-discarded.html inspector/debugger/script-formatter-console.html inspector/debugger/script-formatter-breakpoints.html inspector/debugger/linkifier.html
Comment on attachment 189935 [details] Patch Attachment 189935 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/16737251 New failing tests: platform/mac/editing/deleting/deletionUI-single-instance.html inspector/debugger/script-formatter-console.html inspector/debugger/script-formatter-breakpoints.html
Created attachment 190006 [details] Patch
Comment on attachment 190006 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190006&action=review > Source/WebCore/inspector/front-end/utilities.js:707 > + // It has to be string for better performance. Please explain that it is done to make sure that the object is not converted into an Array by VM because of consecutive integer keys.
Created attachment 190011 [details] Patch
Created attachment 190012 [details] Patch
Comment on attachment 190012 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190012&action=review > Source/WebCore/inspector/front-end/UISourceCode.js:55 > + * @type {Object.<number, WebInspector.LiveLocation>} wrong @type? > Source/WebCore/inspector/front-end/utilities.js:705 > +var createObjectIdentifier = function() /** @return {string} */ > Source/WebCore/inspector/front-end/utilities.js:708 > + return '_' + ++createObjectIdentifier._last; ' -> " > Source/WebCore/inspector/front-end/utilities.js:718 > + this._set = {}; plz add @type !Object.<...> > Source/WebCore/inspector/front-end/utilities.js:739 > + * @param {Object} item {Object} -> {!Object} > Source/WebCore/inspector/front-end/utilities.js:743 > + if (this._set[item.__identifier]) { maybe a check on item.__identifier for consistency with the #add method > Source/WebCore/inspector/front-end/utilities.js:750 > + * @return {Array.<Object>} Array -> !Array > Source/WebCore/inspector/front-end/utilities.js:762 > + * @param {Object} item @return is missing
Oops, I must have removed Pavel's r+ due to a collision.
Committed r143889: <http://trac.webkit.org/changeset/143889>
comments addressed