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
Random performance tests for on the fly testing.
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js">
</script>
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
var testArray = [];
for(var i = 0; i < 10000; i++) {
testArray.push(i);
}
function test_for() {
for (var i = 0; i < testArray.length; i++) {
testInLoop(testArray[i]);
}
}
function test_for_each() {
testArray.forEach(function(i, j) {
testInLoop(i);
});
}
function test_angular_for_each() {
angular.forEach(testArray, function(i) {
testInLoop(i);
});
}
function test_jquery_each() {
$.each(testArray, function(j, i) {
testInLoop(i);
});
}
function testInLoop(i) {
return (i * i);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
For |
| ready |
Array ForEach |
| ready |
Angular ForEach |
| ready |
Jquery Each |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.