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
Demonstrating the performance hit caused by nested functions and testing against module pattern, without certain module pattern.
<script>
function mySandwich(param1, param2, callback) {
console.log('Started eating my sandwich.\n\nIt has: ' + param1 + ', ' + param2);
var sth = "test";
callback(sth);
}
// Non nested function inner function
function mycallback(sth) {
console.log('Finished eating my sandwich.' + sth);
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Optimized (No Nesting) |
| ready |
Nested Function |
| ready |
still nested |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.