Plus Equals New vs Equals Old Plus New (v3)

Revision 3 of this benchmark created by Russell Dempsey on


Description

I've always used

foo += bar;

for string concatenation but I'm curious how it performs against

foo = foo + bar;

at high volume.

Setup

var a = 'hello';
    var b = ' world, ';

Test runner

Ready to run.

Testing in
TestOps/sec
A Plus Equals B
a += b
ready
A Equals A plus B
a = a + b
ready

Revisions

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