ExtJS Array merging (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/extjs/4.2.1/ext-all.js"></script>

Setup

var a= [],
        b= [],
        gen = function(){ return Math.random().toString(36).substring(7);};
    
    for(var i=0; i<5000; i++){
        a.push(gen());
        b.push(gen());
    }

Test runner

Ready to run.

Testing in
TestOps/sec
standard loop
for(var i=0; i<b.length; i++) a.push(b[i]);
ready
Ext.merge
Ext.merge(a,b);
ready
Ext.Array.merge
Ext.Array.merge(a,b);
ready
Ext.each
Ext.each(b,function(i){a.push(i);});
ready
Ext.apply
Ext.apply(a,b);
ready
concat
a.concat(b);
ready

Revisions

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