simey-if vs if (v5)

Revision 5 of this benchmark created by Jake on


Description

if( a && b ) { x } versus if (a){ if(b) { x } }

Setup

var a = true;
    var b = true;
    var x = true;

Test runner

Ready to run.

Testing in
TestOps/sec
inline
if ( a && b ) {
  x = false;
}
ready
nested
if ( a ) {
 if ( b ) {
  x = false;
 }
}
ready
inline false
if ( a && !b ) {
  x = false;
}
ready
nested false
if ( a ) {
 if ( !b ) {
  x = false;
 }
}
ready
inline true
if ( !a && b ) {
  x = false;
}
ready
nested true
if ( !a ) {
 if ( b ) {
  x = false;
 }
}
ready
expr TT (with assignment of false)
x = (a && b, false)
ready
expr TF
x = a && !b
ready
expr F
x = !a
ready

Revisions

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