string append time complexity

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Append10
str = "";
for (let i = 0; i < 10; ++i) {
  str += "a";
}
ready
Append100_000
str = "";
for (let i = 0; i < 100_000; ++i) {
  str += "a";
}
ready
Append1_000_000
str = "";
for (let i = 0; i < 1_000_000; ++i) {
  str += "a";
}
ready
Append1_000_000str+a
str = "";
for (let i = 0; i < 1_000_000; ++i) {
  str = str + "a";
}
ready

Revisions

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