Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Tab length
(version: 10)
Comparing performance of:
test 1 vs test 2 vs test 3 vs test 4
Created:
9 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
Script Preparation code:
var tab = []; tab[999]= null; var i = 0; var sum = 0;
Tests:
test 1
for(i=0; i<tab.length;i++){sum += 1;}
test 2
var a = tab.length; for(i=0; i<a;i++){sum += 1;}
test 3
_.forEach(tab, function(){sum += 1;});
test 4
angular.forEach(tab, function() {sum += 1;});
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
test 1
test 2
test 3
test 4
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Tab length
Tab length
For in vs Reduce
Lodash's Sum vs Reduce vs For-Loop
Comments
Confirm delete:
Do you really want to delete benchmark?