try-catch-performance-jls

Benchmark created by Joseph Sheedy on


Test runner

Ready to run.

Testing in
TestOps/sec
try-catch
y = 0;
try {
  x = y();
} catch (e) {
  x = null;
}
ready
if
y = 0;
if (typeof(y) === 'function') {
  x = y();
} else {
  x = null;
}
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