[Webkit-unassigned] [Bug 78393] New: dom/Events.html spends 7% of total time in Array.splice

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 10 15:26:14 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=78393

           Summary: dom/Events.html spends 7% of total time in
                    Array.splice
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Tools / Tests
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: eric at webkit.org
                CC: abarth at webkit.org, rniwa at webkit.org


dom/Events.html spends 7% of total time in Array.splice

I think it's an error in the benchmark.  The "splice" call is just in a cleanup call:

    // Sets up for testing performance of removing event handlers.
    this.SetupForTeardown = function() {

I'm not even sure it wants to use splice here:

        while (tmp.length > 0) {
            var index = Math.floor(Math.random() * tmp.length);
            me.random_ids.push(tmp.splice(index, 1));
        }

    // Tests removing event handlers.
    this.TeardownTest = function() {
        var node_count = 0;
        for (var i = 0; i < me.random_ids.length; i++) {
            var col = document.getElementById(me.random_ids[i]);

splice returns an Array.  push, when passed an Array should add the whole Array as an element, no?
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/push

So then me.random_ids[i] is returning an array?  We're then passing an Array (with one value) to getElementById?

Anyway, seems wrong that this benchmark, which is supposedly about Event dispatch spends all its time in Array.splice.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list