Test template litteral vs string

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Template
for(let i = 0 ; i <10000; ++i) {

   x = `azerrty\n`
   + `azerrty\n`
   + `azerrty\n`
   + `azerrty\n`
   }
ready
Strings
for(let i = 0 ; i <10000; ++i) {

   x = "azerrty\n"
    + "azerrty\n"
    + "azerrty\n"
    + "azerrty\n"
   }
ready
Template lines
for(let i = 0 ; i <10000; ++i) {

   x = `azerrty
azerrty
azerrty
azerrty\n`
   }
ready
Guillements +=
for(let i = 0 ; i <10000; ++i) {

   x = "azerrty\n"
   x += "azerrty\n"
   x += "azerrty\n"
   x += "azerrty\n"
   }
ready

Revisions

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