Inline ArrayIteratorPrototypeOptimizable with a constant when possible

RESOLVED FIXED in Firefox 67

Status

()

enhancement
RESOLVED FIXED
5 months ago
4 months ago

People

(Reporter: anba, Assigned: anba)

Tracking

Trunk
mozilla67
Points:
---

Firefox Tracking Flags

(firefox67 fixed)

Details

Attachments

(1 attachment)

bug 1358501 makes this easy to do.

Improves this µ-benchmark from 135ms to 110ms for me. (new Int32Array(xs[i & 1]) is now even slower in comparison at ~190ms for that µ-benchmark. Whoops...)

function f() {
    var xs = [[1,2,3,4,5,6,7,8], [1,2,3,4,5,6,7,8]];
    var r = 0;
    var t = dateNow();
    for (var i = 0; i < 1000000; ++i) {
        r += Int32Array.from(xs[i & 1]).length;
    }
    return [dateNow() - t, r];
}
Attachment #9047113 - Flags: review?(jdemooij)
Comment on attachment 9047113 [details] [diff] [review]
bug1531073.patch

Review of attachment 9047113 [details] [diff] [review]:
-----------------------------------------------------------------

Nice idea.
Attachment #9047113 - Flags: review?(jdemooij) → review+

Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/14d519134002
Inline ArrayIteratorPrototypeOptimizable with a constant when possible. r=jandem

Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.