Closed Bug 1415124 Opened 3 years ago Closed 3 years ago

Nursery allocate cloned lexical environments

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
In LexicalEnvironmentObject::clone and LexicalEnvironmentObject::recreate we currently pass TenuredHeap but we can just use DefaultHeap AFAIK. We already nursery allocate other environment objects (CallObjects for instance) so I don't expect problems with this.

Improves the micro-benchmark below from 1550 ms to 700 ms.

function f() {
    var arr = [];
    for (var i = 0; i < 10000000; i++)
        arr.push({});
    var t = new Date;
    for (let i = 0; i < 10000000; i++) {
        g = () => i;
    }
    print(new Date - t);
}
f();
Attachment #8925877 - Flags: review?(jcoppeard)
Comment on attachment 8925877 [details] [diff] [review]
Patch

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

Yes this looks fine.
Attachment #8925877 - Flags: review?(jcoppeard) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e4397a936799
Nursery allocate cloned LexicalEnvironmentObjects. r=jonco
Either this or the patch from bug 1415161 regressed some benchmarks from Ares 6 on AWFY.
https://hg.mozilla.org/mozilla-central/rev/e4397a936799
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.