slice-method-vs-generic

Benchmark created by Kyle Simpson on


Preparation HTML

<script>
var a = [1,2,3,4,5,6,7,8,9,10],
    b = [1,2,3,4,5,6,7,8,9,10],
    i;

var ARRSLICE_1 = [].slice;
var ARRSLICE_2 = Function.call.bind(Array.prototype.slice);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
method
for (i=0; i<a.length; i++) {
   b[i] = ARRSLICE_1.call(a,i,i+2);
}
ready
generic
for (i=0; i<a.length; i++) {
   b[i] = ARRSLICE_2(a,i,i+2);
}
ready

Revisions

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

  • Revision 1: published by Kyle Simpson on