Script Preparation code:
AخA
 
var arr = [1,2,3,4,5,6,7,8,9,0], farr;
Tests:
  • Filter

     
    farr = arr.filter(function(item) { 
      return (item>4); 
    });
  • For

     
    for (var i=0,len=arr.length;i<len;i++) {
      if (arr[i]<5) continue;
      farr.push(arr[i]);
    }
  • For 2

     
    for (var i=0,len=arr.length;i<len;i++) {
      if (arr[i]>4) farr.push(arr[i]);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Filter
    For
    For 2

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 11 months ago)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Chrome 117 on Android
View result in a separate tab
Test name Executions per second
Filter 1328613.6 Ops/sec
For 193856.7 Ops/sec
For 2 200674.0 Ops/sec