Try/Catch Block Performance Comparison (v13)

Revision 13 of this benchmark created by Zach McElrath on


Description

Measuring the performance implications of a try/catch block.

Preparation HTML

<script>
    var skuid = {
   divide: function(a,b){
      return a / b;
   }
};
try {
   var skuid2 = {
       divide: function(a,b){
           return a / b;
       }
   };
} catch (e) {
    window.alert(e);
}
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Plain
skuid(2000,2000);
ready
Try/Catch Block
skuid2(2000,2000);
ready
Try/Catch Block With Error
skuid2(2000,0);
ready

Revisions

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