Try/Catch No-Error Perf (v68)

Revision 68 of this benchmark created on


Description

Determines the impact in performance of try-catch blocks when no error is thrown.

Preparation HTML

<script>
  var someValue = "I'm a thing";
  function tryCatch(undef) {
    try {
      return someValue;
    } catch (ex) {
      return null;
    }
  }

  function ifCheck(undef) {
    return someValue;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Try Catch
tryCatch();
ready
If Check
ifCheck();
ready

Revisions

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