Performance Javascript: array vs objects

Benchmark created by EtnasSoft on


Test runner

Ready to run.

Testing in
TestOps/sec
Arrays
var myArr = [];

//code to evaluate
for (i = 0; i < 10000; i++) {
 myArr[i] = 'Lorem Ipsum';
}
ready
Objects
var myObj = {};

// Code to evalueate
for (i = 0; i < 10000; i++) {
 myObj[i] = 'Lorem Ipsum';
}
ready

Revisions

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