Lodash vs. Ramda

JavaScript performance comparison

Test case created by Nick Barker

Preparation code

<script src="http://cdnjs.cloudflare.com/ajax/libs/ramda/0.23.0/ramda.min.js"></script>
<script src="https://cdn.jsdelivr.net/lodash/4.17.4/lodash.min.js"></script>
      
<script>
Benchmark.prototype.setup = function() {
  var data = [];
  for (var i = 0; i < 10000; i++) {
  data[i] = i;
  }
  
  function transform(i) {
  return i * 3 + 5;
  }
  
  function isOdd(i) {
  return i % 2 == 0;
  }

};
</script>

Preparation code output

<script src="https://cdn.jsdelivr.net/lodash/4.17.4/lodash.min.js"></script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Lodash
const result = _.filter(_.map(data, transform), isOdd)
pending…
Ramda
const result = R.filter(isOdd, R.map(transform, data))
pending…

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL.

0 Comments