Bug 102813

Summary: Web Inspector: DataGrid: avoid repetitive access to node data field.
Product: WebKit Reporter: eustas.bug
Component: Web Inspector (Deprecated)Assignee: eustas.bug
Status: RESOLVED INVALID    
Severity: Normal CC: apavlov, caseq, eustas.bug, keishi, loislo, pfeldman, pmuellr, vsevik, web-inspector-bugs, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch pfeldman: review-

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.