Y.clone vs concat

Benchmark created by Juan on


Preparation HTML

<script src="http://yui.yahooapis.com/3.3.0/build/simpleyui/simpleyui.js"></script>

<script>
  var arr = [];
  for (var i = 0; i < 10000; i++) {
    arr.push(i);
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Y.clone
var arr2 = Y.clone(arr);
ready
concat
var arr3 = arr.concat();
ready
slice
var arr4 = arr.slice();
ready

Revisions

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