loop perforamance (v2)

Revision 2 of this benchmark created on


Setup

var arr = Array.apply(null, Array(100)).map(function(el, i){return {value: i}}),
        res

Test runner

Ready to run.

Testing in
TestOps/sec
for
for(var i = 0, len = arr.length; i < len; i++){
    res = arr[i]
}
ready
while
var i = -1,
    len = arr.length
while(i++ < len){
    res = arr[i]
}
ready
while reverse
var i = arr.length
while(i--){
    res = arr[i]
}
ready
for (no cache)
for(var i = 0; i < arr.length; i++){
    res = arr[i]
}
ready

Revisions

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