Script Preparation code:
AخA
 
var c = 0, a = Array(10).fill().map((el,i) => i);var c = 0, a = Array(10).fill().map((el,i) => i); 
Tests:
  • Instanceof if

     
    if(a instanceof Array) ++c;
  • Instanceof npe

     
    c += Number(a instanceof Array);
  • Instanceof mpe

     
    c += (0 + (a instanceof Array));
  • isArray if

     
    if(Array.isArray(a)) ++c;
  • isArray npe

     
    c += Number(Array.isArray(a))
  • isArray mpe

     
    c += (0 + (Array.isArray(a)));
  • Length if

     
    if(a.length > -1) ++c;
  • Length npe

     
    c += Number(a.length > -1);
  • Length mpe

     
    c += (0 + (a.length > -1));
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Instanceof if
    Instanceof npe
    Instanceof mpe
    isArray if
    isArray npe
    isArray mpe
    Length if
    Length npe
    Length mpe

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Linux; Android 12; DE2118) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Mobile Safari/537.36
Chrome Mobile 105 on Android
View result in a separate tab
Test name Executions per second
Instanceof if 727988.6 Ops/sec
Instanceof npe 466704.2 Ops/sec
Instanceof mpe 712120.8 Ops/sec
isArray if 670750.4 Ops/sec
isArray npe 545159.4 Ops/sec
isArray mpe 613199.4 Ops/sec
Length if 1166748.8 Ops/sec
Length npe 730092.0 Ops/sec
Length mpe 1191733.0 Ops/sec