Bug 91744

Summary: Web Inspector: minimize number of properties on WebInspector.TimelinePresentationModel.Record
Product: WebKit Reporter: Andrey Kosyakov <caseq>
Component: Web Inspector (Deprecated)Assignee: Andrey Kosyakov <caseq>
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 pfeldman: review+

Description Andrey Kosyakov 2012-07-19 07:40:00 PDT
We create an instance of WebInspector.TimelinePresentationModel.Record for each timeline record. Most of the formatted record's fields so far are just copies of those on the low-level record. This change replaces those with getters, which reduces amount of space these records occupy nearly twice (11.7M => 6.77M for records, 9.3M => 7.3M for numbers).
Comment 1 Andrey Kosyakov 2012-07-19 07:48:49 PDT
Created attachment 153263 [details]
Patch
Comment 2 Pavel Feldman 2012-07-19 08:27:57 PDT
Comment on attachment 153263 [details]
Patch

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

> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:391
> +    this._style = WebInspector.TimelinePresentationModel.recordStyle(record);

This could be done lazily.

> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:517
> +    get category()

Please annotate new members.

> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:519
> +        return this._style.category

Inline _style here.

> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:524
> +        return this.type === WebInspector.TimelineModel.RecordType.TimeStamp ? this._record.data["message"] : this._style.title;

Inline _style here.

> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:562
> +    get _selfTime()

We never do private getters.

> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:571
> +    },

return null;
Comment 3 Andrey Kosyakov 2012-07-19 09:12:32 PDT
Committed r123108: <http://trac.webkit.org/changeset/123108>