YA String Concat (v17)

Revision 17 of this benchmark created on


Description

Benchmarking string methods given in airbnb's style guide

Test runner

Ready to run.

Testing in
TestOps/sec
Long string without breaks
var errorMessage = 'This is a super, super, super extra super long error that was thrown because of Batman. He is afterall the Batman, who else? When you stop to think about how Batman had anything to do with this, you would get nowhere fast. Which is not a great way to get anywhere at all, if you'
re supposedly interested in getting somewhere.Consider not thinking of Batman, unless your life philosophy is based around what Batman would do in
your situation.The answer is fairly simple, he would do what a bat would do .
Or perhaps it was Spiderman that does what a spider would do ?
Or do what a spider does ? I 'm out of ideas...';
ready
Long string with breaks
var errorMessage = 'his is a super, super, super extra super long error that was thrown because of Batman \
He is afterall the Batman, who else? When you stop to think about how Batman had anything to do with this, \
you would get nowhere fast. Which is not a great way to get anywhere at all, if you'
re supposedly interested in getting somewhere.\
Consider not thinking of Batman, unless your life philosophy is based around what Batman would do in
your situation.\
The answer is fairly simple, he would do what a bat would do .\
Or do what a spider does ? I 'm out of ideas...';
ready
Long string with concats
var errorMessage = 'his is a super, super, super extra super long error that was thrown because of Batman ' +
  'He is afterall the Batman, who else? When you stop to think about how Batman had anything to do with this, ' +
  'you would get nowhere fast. Which is not a great way to get anywhere at all, if you'
re supposedly interested in getting somewhere.
' +
'
Consider not thinking of Batman, unless your life philosophy is based around what Batman would do in
your situation.
' +
'
The answer is fairly simple, he would do what a bat would do .
' +
'
Or
do what a spider does ? I 'm out of ideas...';
ready

Revisions

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