concat vs push_join (faster) (v28)

Revision 28 of this benchmark created by Ricardo on


Description

How to concat strings faster.

Setup

var c, ret,
    s1 = "Test1",
    s2 = "Test2";

Test runner

Ready to run.

Testing in
TestOps/sec
concat
c = "";
ret = "";

c += s1;
c += s2;

ret += c;
return ret;
ready
push_join
c = [];
ret = [];

c.push(s1);
c.push(s2);

ret.push(c.join(""));
return ret.join("");
ready

Revisions

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