try-catch-performance-2 (v2)

Revision 2 of this benchmark created by Andrew Thomas on


Setup

x = 0;
  f = function (x) { return ++x; }

Test runner

Ready to run.

Testing in
TestOps/sec
try-no-catch
try {
  x ++;
} catch (e) {
}
ready
unprotected
x ++;
ready
try-catch
try {
  throw "hi";
} catch (e) {
}
ready
one-function-call
x = f(x);
ready
two-function-calls
x = f(x);
x = f(x);
ready
ten-function-calls
x = f(x);
x = f(x);
x = f(x);
x = f(x);
x = f(x);
x = f(x);
x = f(x);
x = f(x);
x = f(x);
x = f(x);
ready

Revisions

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

  • Revision 1: published by Joseph Sheedy on
  • Revision 2: published by Andrew Thomas on
  • Revision 3: published on