jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
Added native js forEach to the comparisons plus from version 6 added passing the value from array to each test in order to make the test more meaningful all around.
Added simple ForEach function for demonstration.
Added Lazy.js, Zepto and minimal.js in version 8
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.min.js"></script>
<script src="http://code.jquery.com/jquery-git2.js"></script>
<script src="https://rawgithub.com/timmywil/minimal/master/src/minimal.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
var array = ["one", "two", "three", 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
var cb = function(item){};
// For comparison
function ForEach(array, cb) {
var i = 0, len = array.length;
for (i; i < len; i++) {
cb(array[i]);
}
}
Ready to run.
Test | Ops/sec | |
---|---|---|
jQuery .each() |
| ready |
Lo-dash _.each() |
| ready |
standard for loop |
| ready |
optimised for loop |
| ready |
optimised 2 for loop |
| ready |
while-- |
| ready |
array.forEach |
| ready |
[].forEach.call() |
| ready |
ForEach |
| ready |
Zepto.each |
| ready |
minimal.each |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.