Bug 91744 - Web Inspector: minimize number of properties on WebInspector.TimelinePresentationModel.Record
Summary: Web Inspector: minimize number of properties on WebInspector.TimelinePresenta...
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: Andrey Kosyakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-19 07:40 PDT by Andrey Kosyakov
Modified: 2012-07-19 09:12 PDT (History)
10 users (show)

See Also:


Attachments
Patch (8.29 KB, patch)
2012-07-19 07:48 PDT, Andrey Kosyakov
pfeldman: review+
Details | Formatted Diff | Diff

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