Probando el for vs each (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

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';
}

for (i = 0; i < 10000; i++) {}
ready
Objects
var myArr = [];

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

$.each(myArr,function(index,element){})
ready

Revisions

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