Bug 85477 - Web Inspector: createRawLocationByURL is too slow if a big number of evals happen.
Summary: Web Inspector: createRawLocationByURL is too slow if a big number of evals ha...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ilya Tikhonovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-03 05:06 PDT by Ilya Tikhonovsky
Modified: 2012-05-04 02:09 PDT (History)
10 users (show)

See Also:


Attachments
Patch (10.24 KB, patch)
2012-05-03 05:36 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
Patch (10.87 KB, patch)
2012-05-04 01:26 PDT, Ilya Tikhonovsky
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>