array push multiple calls vs multiple args (v6)

Revision 6 of this benchmark created on


Description

Work around out of memory in IE8

Setup

var a = [];
    var arr = [1];
    var push = Array.prototype.push;

Test runner

Ready to run.

Testing in
TestOps/sec
multiple calls to push
a.push(1);
a.push(2);
a.push(3);
a.push(4);
a.push(5);
ready
multiple args to push
a.push(1, 2, 3, 4, 5);
ready
apply array to push
Array.prototype.push.apply(a, [1, 2, 3, 4, 5]);
ready
apply array to push 2
Array.prototype.push.apply(a, arr);
ready
apply array to push 3
push.apply(a, arr);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.