Script Preparation code:
AخA
 
window.nums = new Array(1000).fill(0).map((x,i) => i)
Tests:
  • Functional

    x
     
    const y = nums.filter(x => x%2).map(x => x*3).filter(x => x < 100)
    return y
  • Imperative

     
    const y = []
    for(const x of nums) {
      if(x%2) {
        const x3 = x*3;
        if(x3 < 100) {
          y.push(x3)
        }
      }
    }
    return y
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Functional
    Imperative

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 16 days ago)
Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126 on Chrome OS 14541.0.0
View result in a separate tab
Test name Executions per second
Functional 33453.0 Ops/sec
Imperative 231100.0 Ops/sec