ExtJS Array merging (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="http://cdn.sencha.io/ext-4.1.0-gpl/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
standard concat
a = a.concat(b);
ready

Revisions

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