string concat vs array join: changing text (v68)

Revision 68 of this benchmark created by quarteris on


Test runner

Ready to run.

Testing in
TestOps/sec
Concat
var text = '', append = '', arr = [];
for (var i = 0; i < 50; ++i)
{
    append = 'test'+i;
    text += append;
}

ready
Push and join
var text = '', append = '', arr = [];
for (var i = 0; i < 50; ++i)
{
    append = 'test'+i;
    arr.push(append);
}
text = arr.join('');
ready
Insert and join
var text = '', append = '', arr = [];
for (var i = 0; i < 50; ++i)
{
    append = 'test'+i;
    arr[i] = append;
}
text = arr.join('');
ready

Revisions

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