big string build

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
byte at a time
var bytes = 1024*1024
var str = '';
for (var i = 0; i < bytes; i++) {
    str += 'x';
}
ready
doubling
var bytes = 1024*1024
var str = 'x';
while (str.length < bytes) {
    str += str;
}
ready
Array.toString()
var bytes = 1024*1024
var str = Array(bytes+1).toString();
ready

Revisions

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