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
<script>
var JS = 'function fibonacci(n) {\
if (n < 2) {\
return 1;\
} else {\
return fibonacci(n-2) + fibonacci(n-1);\
}\
}';
function fibonacci(n) {
if (n < 2) {
return 1;
} else {
return fibonacci(n-2) + fibonacci(n-1);
}
}
eval(JS.replace(/fibonacci/g, 'fibonacciEval'));
var fibonacciFn = Function('n','\
if (n < 2) {\
return 1;\
} else {\
return fibonacciFn(n-2) + fibonacciFn(n-1);\
}\
');
(function() {
var head = document.getElementsByTagName('head')[0];
var el = document.createElement('script');
el.innerHTML = JS.replace(/fibonacci/g, 'fibonacciScript');
head.appendChild(el);
}());
</script>
var fibonacci = window.fibonacci,
fibonacciEval = window.fibonacciEval,
fibonacciFn = window.fibonacciFn,
fibonacciScript = window.fibonacciScript;
Ready to run.
Test | Ops/sec | |
---|---|---|
eval |
| ready |
script |
| ready |
Function |
| ready |
normal |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.