Bug 85477

Summary: Web Inspector: createRawLocationByURL is too slow if a big number of evals happen.
Product: WebKit Reporter: Ilya Tikhonovsky <loislo>
Component: Web Inspector (Deprecated)Assignee: Ilya Tikhonovsky <loislo>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch yurys: review+

Description Ilya Tikhonovsky 2012-05-03 05:06:29 PDT
It iterates through all the _scripts even they have no url.
We can keep a separate map of scripts with url.
Comment 1 Ilya Tikhonovsky 2012-05-03 05:36:17 PDT
Created attachment 139990 [details]
Patch
Comment 2 Yury Semikhatsky 2012-05-03 05:46:23 PDT
Comment on attachment 139990 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=139990&action=review

> Source/WebCore/inspector/front-end/DebuggerModel.js:226
> +    _resetScriptsMap: function()

_resetScriptsMap -> _resetScriptMaps ?

> Source/WebCore/inspector/front-end/DebuggerModel.js:338
> +            this._scriptsWithSourceURL[scriptId] = script;

Let's introduce a multimap from source URL to scripts instead to avoid the linear pass.
Comment 3 Ilya Tikhonovsky 2012-05-04 01:26:11 PDT
Created attachment 140179 [details]
Patch
Comment 4 Yury Semikhatsky 2012-05-04 01:43:51 PDT
Comment on attachment 140179 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=140179&action=review

> Source/WebCore/inspector/front-end/DebuggerModel.js:337
> +                scripts = {};

You never get a script by id from this map, why not use an array of scripts instead?
Comment 5 Pavel Feldman 2012-05-04 01:47:14 PDT
Comment on attachment 140179 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=140179&action=review

> Source/WebCore/inspector/front-end/DebuggerModel.js:223
> +    _resetScriptsMaps: function()

_reset ?
Comment 6 Ilya Tikhonovsky 2012-05-04 02:09:25 PDT
Committed r116077: <http://trac.webkit.org/changeset/116077>