fib nomal vs asm.js (v21)

Revision 21 of this benchmark created by sdfsdf on


Setup

var fibNomal = (function () {
    function fib(x) {
      x = x;
      if ((x) < 3) return 1;
      return ((fib((x - 2)) ) + (fib((x - 1) ) )) ;
    }
    return fib;
  })();
  
  var fibAsmjs = (function () {
    function fib(x) {
      x = x | 0;
      if ((x | 0) < 3) return 1;
      return ((fib((x - 2) | 0) | 0) + (fib((x - 1) | 0) | 0)) | 0;
    }
    return fib;
  })();

Test runner

Ready to run.

Testing in
TestOps/sec
fib nomal
fibNomal(20);
ready
fib asm.js
fibAsmjs(20);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.