Array Set Difference

JavaScript performance comparison

Revision 2 of this test case created by Nathan and last updated

Preparation code

<script src="https://fireboltjs.com/firebolt.min.js"></script>
<script src="https://underscorejs.org/underscore-min.js"></script>
<script>
var array = [1,2,3,4,5,6,7,8,9,0],
    sub1 = [1,7,8,4],
    sub2 = [7,3,0];
</script>
    

Preparation code output

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
Firebolt
array.diff(sub1);
array.diff(sub1, sub2);
pending…
Underscore
_.difference(array, sub1);
_.difference(array, sub1, sub2);
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.

0 Comments