HTML Preparation code:
AخA
 
1
<script src="//cdnjs.cloudflare.com/ajax/libs/ramda/0.25.0/ramda.min.js"></script>
2
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js"></script>
3
<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/immutable/3.8.2/immutable.min.js'></script>
Script Preparation code:
 
var data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30];
Tests:
  • Ramda.map

     
    R.map((n) => n*n, data);
  • Array.prototype.map

     
    data.map((n) => n*n);
  • lodash.map

     
    _.map(data, (n) => n*n);
  • Immutable.map

     
    Immutable.fromJS(data).map((n) => n*n)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Ramda.map
    Array.prototype.map
    lodash.map
    Immutable.map

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 11 days ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Linux
View result in a separate tab
Test name Executions per second
Ramda.map 11877478.0 Ops/sec
Array.prototype.map 9251283.0 Ops/sec
lodash.map 19569794.0 Ops/sec
Immutable.map 1072676.5 Ops/sec