binary speed

Benchmark created by Oscar Gomez on


Setup

var A = false;
  var B = true;
  var loops = 1000;

Test runner

Ready to run.

Testing in
TestOps/sec
!A && !B
for(x=0; x<loops; x++) {
  if (!A && !A) { console.log('A-A'); }
  if (!A && !B) { console.log('A-B'); }
  if (!B && !A) { console.log('B-A'); }
  if (!B && !B) { console.log('B-B'); }
}
ready
!(A || B)
for(x=0; x<loops; x++) {
  if (!(A || A)) { console.log('A-A'); }
  if (!(A || B)) { console.log('A-B'); }
  if (!(B || A)) { console.log('B-A'); }
  if (!(B || B)) { console.log('B-B'); }
}
ready

Revisions

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

  • Revision 1: published by Oscar Gomez on