Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4033.2 Safari/537.36
Chrome 81
Linux
Desktop
4 years ago
Test name Executions per second
JSON.stringify (numbers) 842754.3 Ops/sec
JSON.stringify (strings) 701421.1 Ops/sec
Template Strings (numbers) 1610547.2 Ops/sec
Template Strings (strings) 1629762.5 Ops/sec
String Concatenation (numbers) 1645775.8 Ops/sec
String Concatenation (strings) 1720763.4 Ops/sec
Script Preparation code:
Tests:
  • JSON.stringify (numbers)

  • JSON.stringify (strings)

  • Template Strings (numbers)

  • Template Strings (strings)

  • String Concatenation (numbers)

  • String Concatenation (strings)