String join vs String concat (v2)

Revision 2 of this benchmark created on


Setup

const data = 'home_circuit,deviceType=VA01,serialNo=VA456,heatingCircuit=4 ambientLightLevel=1.0,batteryVoltage=2.957,humidity=61.3,insideTemperature=1998i,rawInsideTemperature=1998i,rawInsideTemperature2ndSensor=1959i,rotaryEncoderState=0i,supplyVoltage=0.0 1718868909154000000\n'.repeat(5000).split('\n');

Test runner

Ready to run.

Testing in
TestOps/sec
join
const result = data.join('\n');
ready
concat
let result = "";
for(let i = 0; i < data.length; i++) {
	result += data[i];
}
ready

Revisions

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