Bug 106897 - Web Inspector: array grouping does not work big sparse arrays
Summary: Web Inspector: array grouping does not work big sparse arrays
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 Adaikin
URL:
Keywords:
Depends on: 106891
Blocks: 107115
  Show dependency treegraph
 
Reported: 2013-01-15 06:00 PST by Andrey Adaikin
Modified: 2013-01-18 08:00 PST (History)
9 users (show)

See Also:


Attachments
Patch (8.23 KB, patch)
2013-01-15 06:03 PST, Andrey Adaikin
no flags Details | Formatted Diff | Diff
Patch (9.52 KB, patch)
2013-01-15 09:12 PST, Andrey Adaikin
no flags Details | Formatted Diff | Diff
Patch (11.38 KB, patch)
2013-01-16 04:04 PST, Andrey Adaikin
no flags Details | Formatted Diff | Diff
Rebased (11.60 KB, patch)
2013-01-17 05:47 PST, Andrey Adaikin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Adaikin 2013-01-15 06:00:13 PST
Patch to follow.

This test takes too much time since there is a linear array index iteration:

    var f = [];
    f[4294967294] = 4294967294;
    console.log("%O", f)

Now we will choose between array index iteration and object properties iteration for sparse arrays.
Comment 1 Andrey Adaikin 2013-01-15 06:03:49 PST
Created attachment 182747 [details]
Patch
Comment 2 Andrey Adaikin 2013-01-15 09:12:41 PST
Created attachment 182787 [details]
Patch
Comment 3 Pavel Feldman 2013-01-16 01:20:49 PST
Comment on attachment 182787 [details]
Patch

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

> Source/WebCore/ChangeLog:8
> +        Now we will choose between array index iteration and object properties iteration for sparse arrays.

It is not clear from the test case how this helps.

> Source/WebCore/inspector/front-end/ObjectPropertiesSection.js:651
> +            if (toIndex - fromIndex < 250000) {

Magic number

> Source/WebCore/inspector/front-end/ObjectPropertiesSection.js:749
> +            var ownPropertyNames = Object.getOwnPropertyNames(this);

Looks like a lot of copypaste.
Comment 4 Andrey Adaikin 2013-01-16 03:36:27 PST
Comment on attachment 182787 [details]
Patch

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

>> Source/WebCore/ChangeLog:8
>> +        Now we will choose between array index iteration and object properties iteration for sparse arrays.
> 
> It is not clear from the test case how this helps.

otherwise it times out.

>> Source/WebCore/inspector/front-end/ObjectPropertiesSection.js:651
>> +            if (toIndex - fromIndex < 250000) {
> 
> Magic number

done.

>> Source/WebCore/inspector/front-end/ObjectPropertiesSection.js:749
>> +            var ownPropertyNames = Object.getOwnPropertyNames(this);
> 
> Looks like a lot of copypaste.

Yes, but I don't know how to do better... (any ideas?)
These 2 functions are to be serialized to a string, thus if I extract a shared function, it should be also serialized to a string, passed as an argument to the original two, and evaluated back to the Function. I thought it's too much complicated to avoid (small) code dups.
Comment 5 Andrey Adaikin 2013-01-16 04:04:40 PST
Created attachment 182957 [details]
Patch
Comment 6 Andrey Adaikin 2013-01-17 05:47:46 PST
Created attachment 183172 [details]
Rebased
Comment 7 WebKit Review Bot 2013-01-18 08:00:43 PST
Comment on attachment 183172 [details]
Rebased

Clearing flags on attachment: 183172

Committed r140150: <http://trac.webkit.org/changeset/140150>
Comment 8 WebKit Review Bot 2013-01-18 08:00:50 PST
All reviewed patches have been landed.  Closing bug.