Try/Catch Block Performance Comparison (v6)

Revision 6 of this benchmark created on


Description

Measuring the performance implications of a try/catch block.

Test runner

Ready to run.

Testing in
TestOps/sec
Plain
var a = {foo: { bar: 5 } };
var n = a.foo.bar;
ready
Try/Catch Block
var a = {foo: { bar: 5 } };
try{
    var n = a.foo.bar;
}catch(e){}
ready
Try/Catch Block With Error
var a = { fooo: { bar: 5 } };
try{
    var n = a.foo.bar;
}catch(e){}
ready

Revisions

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