lodash vs underscore intersection
JavaScript performance comparison
Preparation code
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.3/underscore-min.js"></script>
<script>
var underscore = _.noConflict();
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.3/lodash.min.js"></script>
<script>
var lodash = _.noConflict();
</script>
<script>
Benchmark.prototype.setup = function() {
var lodash = window.lodash,
underscore = window.underscore;
var numbers = Array(20);
for (var i = 0; i < 20; i++) {
numbers[i] = i;
}
var others = numbers.slice().reverse();
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Underscore |
|
pending… |
Lo-Dash |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments