Closed Bug 959161 Opened 10 years ago Closed 10 years ago

Use eager allocation for Array(x) inlined in Ion

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
Bug 799122 fixed Array(x) to eagerly allocate for small arrays. This patch updates the Ion-inlined version to do the same.

See bug 626165 comment 6, this wins at least 20% there. The micro-benchmark below improves from 205 ms to 60 ms.

function f() {
    for (var i=0; i<100000; i++) {
	var a = new Array(80);
	for (var j=0; j<a.length; j++) {
	    a[j] = 0;
	}
    }
}
var t = new Date;
f();
print(new Date - t);
Attachment #8359209 - Flags: review?(luke)
Attachment #8359209 - Flags: review?(luke) → review+
fwiw, the micro-benchmark from comment 0 runs in 41ms in JSC and 19ms in v8 on my system (where our shell takes 220ms without the patch that just landed).
https://hg.mozilla.org/mozilla-central/rev/cc0ba35ea087
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: