Try/Catch Error Perf (v66)

Revision 66 of this benchmark created on


Setup

function ifCheck(undef) {
        if (undef !== undefined) {
          return 1;
        } else {
          return 2;
        }
      }
    
      function ifCheckFirst(undef) {
        if (undef === undefined) {
          return 2;
        } else {
          return 1;
        }
      }

Test runner

Ready to run.

Testing in
TestOps/sec
IfCheck: error
ifCheck();
ready
IfCheck: no error
ifCheck({prop: null});
ready
IfCheckFirst: error
ifCheckFirst();
ready
IfCheckFirst: no error
ifCheckFirst({prop: null});
ready
IfCheck: error (but push undef onto stack)
ifCheck(undefined);
ready

Revisions

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