array-unique (v4)

Revision 4 of this benchmark created on


Description

A look back at lodash and underscore from 5 & 3 years ago compared to their latest releases.

Preparation HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/0.1.0/underscore.js"></script>
<script>
var underscore_010 = _;
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore.js"></script>
<script>
var underscore_133 = _.noConflict();
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore.js"></script>
<script>
var underscore_182 = _.noConflict();
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/0.1.0/lodash.js"></script>
<script>
var lodash_010 = _.noConflict();
</script>
<script src="https://jspm.io/system@0.14.js"></script>
<script>
System.import('npm:lodash@3.3.1/array/uniq').then(function(uniq) {
  lodash_331 = { 'uniq': uniq };
  document.getElementById('run').style.display = '';
});
document.getElementById('run').style.display = 'none';
</script>

Setup

var _ = underscore_182,
        array = _.shuffle(_.range(500).concat(_.range(500)));

Test runner

Ready to run.

Testing in
TestOps/sec
underscore v0.1.0
var r = underscore_010.uniq(array);
ready
underscore v1.3.3
var r = underscore_133.uniq(array);
ready
underscore v1.8.2
var r = underscore_182.uniq(array);
ready
lodash v0.1.0
var r = lodash_010.uniq(array);
ready
lodash v3.3.1
var r = lodash_331.uniq(array);
ready

Revisions

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