flat-push

JavaScript performance comparison

Test case created by carrilho

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
   
        function apply(array, items){
            array.push.apply(array, items)
        }
       
        function loop(array, items){
           
            var i = 0,
                l = items.length,
                nl = array.length;
               
            for(; i < l; i++)
                array[nl++] = items[i];
        }
   
};
</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
apply
var a = [1];
apply(a, [2,3,4,5]);
 
pending…
loop
var a = [1];
loop(a, [2,3,4,5]);
pending…

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

Compare results of other browsers

0 comments

Add a comment