Closed Bug 1531073 Opened 2 years ago Closed 2 years ago

Inline ArrayIteratorPrototypeOptimizable with a constant when possible

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

bug 1358501 makes this easy to do.

Attached patch bug1531073.patchSplinter Review

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: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.