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