Closed Bug 1530319 Opened 8 months ago Closed 8 months ago

Don't create singleton functions in proxy_revocable, ReadableStreamCancel, and WASM ResolveResponse

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

It doesn't look like any of the functions created in

really need to be singletons, but instead should be created as GenericObject.

Attached patch bug1530319.patchSplinter Review

I've noticed this first for Proxy.revoke, but the Streams and Wasm cases seem to be similar in that a singleton object isn't actually required there.

Improves the following µ-benchmark from 110ms to 80ms for me:

function f() {
    var r = 0
    var t = dateNow()
    for (var i = 0; i < 100000; ++i) {
        var p = Proxy.revocable({}, {});
    }
    return [dateNow() - t, r];
}
Attachment #9046390 - Flags: review?(jorendorff)
Comment on attachment 9046390 [details] [diff] [review]
bug1530319.patch

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

Sweet discovery.
Attachment #9046390 - Flags: review?(jorendorff) → review+

Pushed by rmaries@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4339eeddc19d
Don't create a singleton objects for functions which can be created multiple times. r=jorendorff

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