Array direct assignment vs push (v14)

Revision 14 of this benchmark created by Charmander on


Setup

var values = [];
    var count = 10000;

Test runner

Ready to run.

Testing in
TestOps/sec
Direct assignment
for(var i = 0; i < count; i++) {
    values[i] = i;
}
ready
Push
for(var i = 0; i < count; i++) {
    values.push(i);
}
ready

Revisions

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