if one line vs brackets (v2)

Revision 2 of this benchmark created on


Setup

var test = Math.random() < .5;
    function yes () {}
    var test1 = function() {
      if (test) {
        yes();
      }
    }
    var test2=function () {if(test) yes();}

Test runner

Ready to run.

Testing in
TestOps/sec
if brackets
test1();
ready
if no brackets
test2();
ready

Revisions

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

  • Revision 1: published by Cole Lawrence on
  • Revision 2: published on