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
/**
* Trampoline 函数,将尾递归函数转换成循环
*/
function trampoline(fn) {
return function(...args) {
let result = fn(...args);
while (typeof result === 'function') {
result = result();
}
return result;
};
}
// 输入
const input = 5000;
Ready to run.
Test | Ops/sec | |
---|---|---|
标准斐波那契函数 |
| ready |
使用蹦床技术的斐波那契函数 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.