myifelseswitchtest

JavaScript performance comparison

Test case created by myifelseswitchtest

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
if
var date1 = 1;
var date2 = 2;
var date3 = 3;
var date4 = 4;
var date5 = 5;
var date6 = 6;
var date7 = 7;
var date8 = 8;
var date9 = 9;
var date10 = 10;
var date11 = 11;
var date12 = 12;
var date13 = 13;
var date14 = 14;
var date15 = 15;
var date16 = 16;
var date17 = 17;
var date18 = 18;
var date19 = 19;
var date20 = 20;

var tester = 19;
if(tester == date1)
return true;
else if(tester==date2)
return true;
else if(tester==date3)
return true;
else if(tester==date4)
return true;
else if(tester==date5)
return true;
else if(tester==date6)
return true;
else if(tester==date7)
return true;
else if(tester==date8)
return true;
else if(tester==date9)
return true;
else if(tester==date10)
return true;
else if(tester==date11)
return true;
else if(tester==date12)
return true;
else if(tester==date13)
return true;
else if(tester==date14)
return true;
else if(tester==date15)
return true;
else if(tester==date16)
return true;
else if(tester==date17)
return true;
else if(tester==date18)
return true;
else if(tester==date19)
return true;
else if(tester==date20)
return true;
pending…
catch
var date1 = 1;
var date2 = 2;
var date3 = 3;
var date4 = 4;
var date5 = 5;
var date6 = 6;
var date7 = 7;
var date8 = 8;
var date9 = 9;
var date10 = 10;
var date11 = 11;
var date12 = 12;
var date13 = 13;
var date14 = 14;
var date15 = 15;
var date16 = 16;
var date17 = 17;
var date18 = 18;
var date19 = 19;
var date20 = 20;

var tester = 19;

switch(tester){
case date1:
return true;
break;
case date2:
return true;
break;
case date3:
return true;
break;
case date4:
return true;
break;
case date5:
return true;
break;
case date6:
return true;
break;
case date7:
return true;
break;
case date8:
return true;
break;
case date9:
return true;
break;
case date10:
return true;
break;
case date11:
return true;
break;
case date12:
return true;
break;
case date13:
return true;
break;
case date14:
return true;
break;
case date15:
return true;
break;
case date16:
return true;
break;
case date17:
return true;
break;
case date18:
return true;
break;
case date19:
return true;
break;
case date20:
return true;
break;

}
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment