Bug 102813 - Web Inspector: DataGrid: avoid repetitive access to node data field.
Summary: Web Inspector: DataGrid: avoid repetitive access to node data field.
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: eustas.bug
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-20 07:05 PST by eustas.bug
Modified: 2014-12-12 13:42 PST (History)
10 users (show)

See Also:


Attachments
Patch (9.38 KB, patch)
2012-11-20 07:07 PST, eustas.bug
no flags Details | Formatted Diff | Diff
Patch (10.42 KB, patch)
2012-11-20 07:11 PST, eustas.bug
pfeldman: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description eustas.bug 2012-11-20 07:05:17 PST
DataGridNode.data is a getter.
Each access to "data" causes construction of object that
contains presentation values for all fields.

There are few loops in which this field is accessed repetitively.
With this patch in most loops "data" result reused.
Comment 1 eustas.bug 2012-11-20 07:07:52 PST
Created attachment 175213 [details]
Patch
Comment 2 eustas.bug 2012-11-20 07:11:18 PST
Created attachment 175214 [details]
Patch
Comment 3 Pavel Feldman 2012-11-22 12:28:04 PST
Comment on attachment 175214 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        Each access to "data" causes construction of object that

Could you explain what object is constructed? I can only see

    get data()
    {
        return this._data;
    },

in WebInspector.DataGridNode.prototype. This does not cost anything.
Comment 4 eustas.bug 2012-11-22 18:44:11 PST
Comment on attachment 175214 [details]
Patch

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

>> Source/WebCore/ChangeLog:9
>> +        Each access to "data" causes construction of object that
> 
> Could you explain what object is constructed? I can only see
> 
>     get data()
>     {
>         return this._data;
>     },
> 
> in WebInspector.DataGridNode.prototype. This does not cost anything.

Most classes that extend DataGridNode override this getter with one that construct object.
Comment 5 Brian Burg 2014-12-12 13:40:47 PST
Closing as invalid, as this bug pertains to the old inspector UI and/or its tests.
Please file a new bug (https://www.webkit.org/new-inspector-bug) if the bug/feature/issue is still relevant to WebKit trunk.