string concat vs array

Benchmark created by Eyal Shilony on


Setup

var str1 = "";
    var str2 = "";
    var arr = [];

Teardown


    str1 = "";
    str2 = "";
    arr = [];
  

Test runner

Ready to run.

Testing in
TestOps/sec
concatenation
str1 += "x";
ready
push
arr.push("x");
ready
concat
str2.concat("x");
ready

Revisions

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

  • Revision 1: published by Eyal Shilony on