Try/Catch Error Perf

JavaScript performance comparison

Revision 66 of this test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
      function ifCheck(undef) {
        if (undef !== undefined) {
          return 1;
        } else {
          return 2;
        }
      }
   
      function ifCheckFirst(undef) {
        if (undef === undefined) {
          return 2;
        } else {
          return 1;
        }
      }
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
IfCheck: error
ifCheck();
pending…
IfCheck: no error
ifCheck({prop: null});
pending…
IfCheckFirst: error
ifCheckFirst();
pending…
IfCheckFirst: no error
ifCheckFirst({prop: null});
pending…
IfCheck: error (but push undef onto stack)
ifCheck(undefined);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment