Bug 113410 - Web Inspector: Flame Chart. Developers will have more clue if two different profiles will have same colors for same functions.
Summary: Web Inspector: Flame Chart. Developers will have more clue if two different p...
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: 2013-03-27 08:26 PDT by Ilya Tikhonovsky
Modified: 2013-03-29 06:55 PDT (History)
8 users (show)

See Also:


Attachments
Patch (6.14 KB, patch)
2013-03-27 08:31 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
Patch (8.06 KB, patch)
2013-03-28 06:14 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
screenshot (129.27 KB, image/png)
2013-03-28 06:20 PDT, Ilya Tikhonovsky
no flags Details
Patch (6.08 KB, patch)
2013-03-29 05:37 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
Patch (5.98 KB, patch)
2013-03-29 05:55 PDT, Ilya Tikhonovsky
pfeldman: 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 2013-03-27 08:26:26 PDT
scenario:

developer made CPUProfile on a page.
developer fixed the problem
developer made another CPUProfile 
developer has to see the difference
but he might be confused by the different colors associated with the same function in the different profiles.
Comment 1 Ilya Tikhonovsky 2013-03-27 08:31:18 PDT
Created attachment 195331 [details]
Patch
Comment 2 Build Bot 2013-03-27 13:59:15 PDT
Comment on attachment 195331 [details]
Patch

Attachment 195331 [details] did not pass win-ews (win):
Output: http://webkit-commit-queue.appspot.com/results/17294365
Comment 3 Pavel Feldman 2013-03-28 04:55:54 PDT
Comment on attachment 195331 [details]
Patch

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

> Source/WebCore/inspector/front-end/FlameChart.js:74
> +    var profilesPanel = WebInspector.panels["profiles"];

FlameChart should not depend on the panel.

> Source/WebCore/inspector/front-end/FlameChart.js:77
> +        this._colorGenerator = profilesPanel.colorGenerator = new WebInspector.FlameChart.ColorGenerator();

A statement per line please.
Comment 4 Ilya Tikhonovsky 2013-03-28 06:14:45 PDT
Created attachment 195549 [details]
Patch
Comment 5 Ilya Tikhonovsky 2013-03-28 06:15:41 PDT
(In reply to comment #3)
> (From update of attachment 195331 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=195331&action=review
> 
> > Source/WebCore/inspector/front-end/FlameChart.js:74
> > +    var profilesPanel = WebInspector.panels["profiles"];
> 
> FlameChart should not depend on the panel.

done

> 
> > Source/WebCore/inspector/front-end/FlameChart.js:77
> > +        this._colorGenerator = profilesPanel.colorGenerator = new WebInspector.FlameChart.ColorGenerator();
> 
> A statement per line please.

done
Comment 6 Ilya Tikhonovsky 2013-03-28 06:20:24 PDT
Created attachment 195551 [details]
screenshot
Comment 7 Pavel Feldman 2013-03-29 05:12:05 PDT
Comment on attachment 195549 [details]
Patch

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

> Source/WebCore/inspector/front-end/FlameChart.js:75
> +    this._colorGenerator = panel.colorGenerator;

You can't declare properties on alien objects, just make it static!

I.e. if (!WebInspector.FlameChart._colorGenerator)
Comment 8 Ilya Tikhonovsky 2013-03-29 05:37:32 PDT
Created attachment 195729 [details]
Patch
Comment 9 Pavel Feldman 2013-03-29 05:44:43 PDT
Comment on attachment 195729 [details]
Patch

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

> Source/WebCore/inspector/front-end/FlameChart.js:74
> +    this._colorGenerator = WebInspector.FlameChart._colorGenerator;

Why do you need local field?

> Source/WebCore/inspector/front-end/FlameChart.js:289
> +        var colorGenerator = this._colorGenerator;

Why do you need this variable?

> Source/WebCore/inspector/front-end/FlameChart.js:348
> +        var colorGenerator = this._colorGenerator;

ditto
Comment 10 Ilya Tikhonovsky 2013-03-29 05:48:29 PDT
Comment on attachment 195729 [details]
Patch

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

>> Source/WebCore/inspector/front-end/FlameChart.js:289
>> +        var colorGenerator = this._colorGenerator;
> 
> Why do you need this variable?

I don't like to access to member field in a cycle which runs huge number of times because usually it reduces performance.
Comment 11 Ilya Tikhonovsky 2013-03-29 05:55:08 PDT
Created attachment 195731 [details]
Patch
Comment 12 Ilya Tikhonovsky 2013-03-29 06:55:21 PDT
Committed r147213: <http://trac.webkit.org/changeset/147213>