Script Preparation code:
x
 
var obj = {param1:"test",param2:"test",param3:"test",param4:"test"}
Tests:
  • Concatenation

     
    for (let i = 0; i < 10000; i++){
        let s = "";
        for (let j = 0; j < 4; j++){
            s += obj[j] + " - "; 
        }
        s = s.substring(0,s.length - 3);
    }
  • Template strings

     
    for (let i = 0; i < 10000; i++){
        let s = `${obj[0]} - ${obj[1]} - ${obj[2]} - ${obj[3]}`;
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Concatenation
    Template strings

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Chrome 110 on Windows
View result in a separate tab
Test name Executions per second
Concatenation 335.1 Ops/sec
Template strings 387.1 Ops/sec