YA String Concat (v6)

Revision 6 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 long error that was thrown because of Batman. When you stop to think about how Batman had anything to do with this, you would get nowhere fast.';
ready
Long string with breaks
var errorMessage = 'This is a super long error that \
was thrown because of Batman. \
When you stop to think about \
how Batman had anything to do \
with this, you would get nowhere \
fast.';
ready
Long string with concats
var errorMessage = 'This is a super long error that ' +
  'was thrown because of Batman.' +
  'When you stop to think about ' +
  'how Batman had anything to do ' +
  'with this, you would get nowhere ' +
  'fast.';
ready
Long string with concats on one line
var errorMessage = 'This is a super long error that ' + 'was thrown because of Batman.' + 'When you stop to think about ' + 'how Batman had anything to do ' + 'with this, you would get nowhere ' + 'fast.';
ready
Long string with concats on separate statements
var errorMessage = 'This is a super long error that ';
errorMessage += 'was thrown because of Batman.';
errorMessage += 'When you stop to think about ';
errorMessage += 'how Batman had anything to do ';
errorMessage += 'with this, you would get nowhere ';
errorMessage += 'fast.';
ready

Revisions

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