concat vs + vs join (v18)

Revision 18 of this benchmark created on


Description

How to concat strings faster.

Test runner

Ready to run.

Testing in
TestOps/sec
concat
'Coucou '.concat('c\'est ', 'nous !');
ready
+
'Coucou ' + 'c\'est ' + 'nous !';
ready
join
['Coucou ', 'c\'est ', 'nous !'].join();
ready
loop
var array  = ['Coucou ', 'c\'est ', 'nous !'];
var result = this.value;
for (var i = -1, l = array.length; ++i < l;) {
        result += array[i];
}
ready

Revisions

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