Ramda vs. Lodash
JavaScript performance comparison
Preparation code
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.17.1/ramda.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js"></script>
<script>
Benchmark.prototype.setup = function() {
var data = _.range(10000).map(function(i) {
return {
counter: i
}
});
function isOdd(num) {
return num % 2 === 1;
}
function square(num) {
return num * num;
}
function lessThanThreeDigits(num) {
return num.toString().length < 3;
}
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
Test | Ops/sec | |
---|---|---|
Lodash
|
|
pending… |
Ramda without relying on currying or composition
|
|
pending… |
Ramda with currying and composition
|
|
pending… |
Native functional
|
|
pending… |
Native imperative
|
|
pending… |
Ramda Into
|
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit
to the URL.
- Revision 1: published Yuri and last updated
- Revision 2: published Yuri and last updated
- Revision 3: published Scott Sauyet and last updated
- Revision 4: published Scott Sauyet
- Revision 5: published and last updated
- Revision 6: published Hanju Kim
- Revision 7: published Hanju Kim
- Revision 8: published Balazs Erdos
- Revision 9: published Balazs Erdos
- Revision 10: published
- Revision 12: published John R. Cui
- Revision 13: published John R. Cui
- Revision 17: published John R. Cui
- Revision 18: published Michael
0 Comments