Large 1KB string concat (v201)

Revision 201 of this benchmark created on


Description

Test string concatenation with large strings.

Setup

s="1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij";

Test runner

Ready to run.

Testing in
TestOps/sec
concat
for(var res = '', i = 0; i < 10000; i++){
res+=s;
}
ready
join-with-push
for(var res = [], i = 0; i < 10000; i++){
res.push(s);
}
res=res.join('');
ready
join-without-push
for(var res = [], i = 0; i < 10000; i++){
res[i]=s;
}
res = res.join('');
ready
concat-pure
for (var res = '', i = 0; i < 10000; i++){
res=res.concat(s);
}
ready
concat old-fashioned
for(var res = '', i = 0; i < 10000; i++){
res=res+s;
}
ready

Revisions

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