Underscore Sort/Unique order

JavaScript performance comparison

Test case created

Preparation code

<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js">
</script>
<script>
Benchmark.prototype.setup = function() {
    var values = []
    for (var i = 0; i < 100000; i++) {
      values.push(Math.random().toString(36).substring(2));
    }
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
uniq, sort
_.uniq(values);
values.sort();
pending…
sort, uniq
values.sort();
_.uniq(values);
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. Here’s a list of current revisions for this page:

0 comments

Add a comment