koEachVsFirst3 (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/ext-core/3/ext-core.js"></script>
<script type='text/javascript' src='knockout-3.4.0.js'></script>

Setup

var array=[]

Test runner

Ready to run.

Testing in
TestOps/sec
first
for(var i=0;i<1000;i++){
array.push(i);
}

ko.utils.arrayForEach(array, function(item){
return item==900});
ready
foreach
for(var i=0;i<1000;i++){
array.push(i);
}


ko.utils.arrayFirst(array, function(item){
return item==900});
ready

Revisions

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