string concat vs array join (v54)

Revision 54 of this benchmark created on


Setup

words = ['this', 'is', 'a', 'test'];

Test runner

Ready to run.

Testing in
TestOps/sec
Concat
var text = '';
for (var i = 0; i < 10000; ++i)
{
    text += '<div>Hello world</div>';
}

ready
Push and join
var arr = [];
for (var i = 0; i < 10000; ++i)
{
    arr.push('<div>Hello world</div>');
}
var text = arr.join('');
ready
Insert and join
var arr = [];
for (var i = 0; i < 10000; ++i)
{
    arr[i] = '<div>Hello world</div>';
}
var text = arr.join('');
ready

Revisions

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