test vs exp

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

Revisions

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