update test

JavaScript performance comparison

Revision 2 of this test case created by ashley

Info

Test prototype update method

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var arr1 = [1,2,3];
    var arr2 = [1,2,3,4,5,6];
   
   
};
</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
prototype udpate
 function update(array, args) {
    var arrayLength = array.length, length = args.length;
    while (length--) array[arrayLength + length] = args[length];
    return array;
  }
  update(arr1, [4,5,6]);
  update(arr2, [7,8,9,10,11,12]);
pending…
native
arr1.concat([4,5,6]);
arr2.concat([7,8,9,10,11,12]);
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