simey-if vs if (v4)

Revision 4 of this benchmark created on


Description

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

Setup

var a = true;
    var b = true;
    var x = true;
    var c = false;

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
assign
x = a && !b
ready
Multiple Un-Nested if's
if (c){
 x = false;
}
if (b){
 x = false;
}
 
ready
Or
if (c || b){
 x = false;
}
ready

Revisions

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