concat, join, map etc... (v3)

Revision 3 of this benchmark created on


Setup

var data = [],
    count = 10000;
while (count--) {
 data.push('a');
}

Test runner

Ready to run.

Testing in
TestOps/sec
loop
var res = '',
    count = 10000;
for (var i=0; i< count; i++) {
 res += '<'+data[i]+'>';
}
ready
map join
var res = data.map(v => '<'+v+'>').join('')
ready
forEach
var res = '';
data.forEach(v => {
 res += '<'+v+'>';
});
ready

Revisions

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