HTML Preparation code:
AخA
 
1
<script src="https://rawgit.com/ramda/ramda/master/dist/ramda.js"></script>
Script Preparation code:
 
var ids = Array.from({ length: 10000 }, (_, index) => index + 1)
var isPositive = i => i % 2 === 0
Tests:
  • Array(map + filter)

     
    ids.map(R.identity).filter(isPositive).map(R.inc)
  • ramda(map + filter)

     
    R.pipe(
      R.map(R.identity),
      R.filter(isPositive),
      R.map(R.inc)
    )(ids)
  • ramda-transducer(map + filter)

    x
     
    const transform = R.pipe(
      R.map(R.identity),
      R.filter(isPositive),
      R.map(R.inc)
    )
    R.transduce(
      transform,
      R.flip(R.append),
      [],
      ids,
    );
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array(map + filter)
    ramda(map + filter)
    ramda-transducer(map + filter)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Array(map + filter) 1987.0 Ops/sec
ramda(map + filter) 3842.9 Ops/sec
ramda-transducer(map + filter) 18.9 Ops/sec