test vs exp (v5)

Revision 5 of this benchmark created on


Setup

function is_something_true() {
      return true;
    }
    
    function is_something_false() {
      return false;
    }

Test runner

Ready to run.

Testing in
TestOps/sec
tri true
var something = (is_something_true()) ? 3 : 4;
ready
tri false
var something = (is_something_false()) ? 3 : 4;
ready
flow true
var something;
if (is_something_true()) {
  something = 3;
} else {
  something = 4;
}
ready
flow false
var something;
if (is_something_false()) {
  something = 3;
} else {
  something = 4;
}
ready
custom
var something;
is_something_true()&&(something = 3);
is_something_false()&&(something = 4);
ready

Revisions

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